(self.webpackChunkpokerPlanner=self.webpackChunkpokerPlanner||[]).push([["vendor"],{"./node_modules/@firebase/util/dist/index.esm2017.js":function(e,t,n){"use strict";n.d(t,{$L:function(){return O},$g:function(){return k},A4:function(){return d},Am:function(){return G},As:function(){return L},Cv:function(){return F},FA:function(){return x},Fy:function(){return w},Hk:function(){return s},I9:function(){return $},Im:function(){return V},K3:function(){return a},KA:function(){return l},Ku:function(){return te},OE:function(){return ee},T9:function(){return _},Tj:function(){return g},Uj:function(){return c},XA:function(){return v},ZQ:function(){return E},bD:function(){return z},cY:function(){return b},dI:function(){return J},eX:function(){return D},g:function(){return P},gR:function(){return U},gz:function(){return W},hp:function(){return K},jZ:function(){return S},kH:function(){return H},kj:function(){return Z},lT:function(){return I},lV:function(){return C},nr:function(){return A},qc:function(){return j},sr:function(){return T},tD:function(){return Q},u:function(){return h},vA:function(){return i},yU:function(){return y},yw:function(){return B},zW:function(){return N}});const r={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw s(t)},s=function(e){return new Error("Firebase Database ("+r.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},o=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;t+=3){const i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,u=a?e[t+2]:0,l=i>>2,c=(3&i)<<4|o>>4;let h=(15&o)<<2|u>>6,d=63&u;a||(d=64,s||(h=64)),r.push(n[l],n[c],n[h],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const i=n[e.charAt(t++)],s=t<e.length?n[e.charAt(t)]:0;++t;const o=t<e.length?n[e.charAt(t)]:64;++t;const a=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==s||null==o||null==a)throw new u;const l=i<<2|s>>4;if(r.push(l),64!==o){const e=s<<4&240|o>>2;if(r.push(e),64!==a){const e=o<<6&192|a;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class u extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const l=function(e){const t=o(e);return a.encodeByteArray(t,!0)},c=function(e){return l(e).replace(/\./g,"")},h=function(e){try{return a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function d(e){return f(void 0,e)}function f(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&"__proto__"!==n&&(e[n]=f(e[n],t[n]));return e}const p=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,m=()=>{try{return p()||(()=>{if("undefined"==typeof process)return;const e={FIREBASE_API_KEY:"AIzaSyAMO8Kwj7ChDikQKJzA7KCp-LYkXDFcKYI",FIREBASE_APP_ID:"1:241782390439:web:c10021e740161f63d1a582",FIREBASE_AUTH_DOMAIN:"tst-project-b3fc3.firebaseapp.com",FIREBASE_DATABASE_URL:"https://tst-project-b3fc3-default-rtdb.europe-west1.firebasedatabase.app",FIREBASE_MESSAGING_SENDERID:"241782390439",FIREBASE_PROJECT_ID:"tst-project-b3fc3",FIREBASE_STORAGE_BUCKET:"tst-project-b3fc3.appspot.com",NODE_ENV:"production"}.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&h(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},g=e=>{var t,n;return null===(n=null===(t=m())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},y=e=>{const t=g(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},_=()=>{var e;return null===(e=m())||void 0===e?void 0:e.config},v=e=>{var t;return null===(t=m())||void 0===t?void 0:t[`_${e}`]};class b{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}}function w(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[c(JSON.stringify({alg:"none",type:"JWT"})),c(JSON.stringify(s)),""].join(".")}function E(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function S(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(E())}function T(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function C(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function I(){const e=E();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function k(){return!0===r.NODE_CLIENT||!0===r.NODE_ADMIN}function A(){return!function(){var e;const t=null===(e=m())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(e){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function N(){try{return"object"==typeof indexedDB}catch(e){return!1}}function D(){return new Promise(((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}))}class P extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,P.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,x.prototype.create)}}class x{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){return e.replace(R,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new P(r,o,n)}}const R=/\{\$([^}]+)}/g;function O(e){return JSON.parse(e)}function L(e){return JSON.stringify(e)}const M=function(e){let t={},n={},r={},i="";try{const s=e.split(".");t=O(h(s[0])||""),n=O(h(s[1])||""),i=s[2],r=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:r,signature:i}},F=function(e){const t=M(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},j=function(e){const t=M(e).claims;return"object"==typeof t&&!0===t.admin};function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function V(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function H(e,t,n){const r={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}function z(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],s=t[i];if(q(n)&&q(s)){if(!z(n,s))return!1}else if(n!==s)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function q(e){return null!==e&&"object"==typeof e}function G(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach((e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function $(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function K(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class W{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const n=this.W_;if("string"==typeof e)for(let r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){const t=n[e-3]^n[e-8]^n[e-14]^n[e-16];n[e]=4294967295&(t<<1|t>>>31)}let r,i,s=this.chain_[0],o=this.chain_[1],a=this.chain_[2],u=this.chain_[3],l=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(r=u^o&(a^u),i=1518500249):(r=o^a^u,i=1859775393):e<60?(r=o&a|u&(o|a),i=2400959708):(r=o^a^u,i=3395469782);const t=(s<<5|s>>>27)+r+l+i+n[e]&4294967295;l=u,u=a,a=4294967295&(o<<30|o>>>2),o=s,s=t}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+u&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const n=t-this.blockSize;let r=0;const i=this.buf_;let s=this.inbuf_;for(;r<t;){if(0===s)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(i[s]=e.charCodeAt(r),++s,++r,s===this.blockSize){this.compress_(i),s=0;break}}else for(;r<t;)if(i[s]=e[r],++s,++r,s===this.blockSize){this.compress_(i),s=0;break}}this.inbuf_=s,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let n=0;for(let t=0;t<5;t++)for(let r=24;r>=0;r-=8)e[n]=this.chain_[t]>>r&255,++n;return e}}function Q(e,t){const n=new Y(e,t);return n.subscribe.bind(n)}class Y{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=X),void 0===r.error&&(r.error=X),void 0===r.complete&&(r.complete=X);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}})),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function X(){}function J(e,t){return`${e} failed: ${t} argument `}const Z=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s>=55296&&s<=56319){const t=s-55296;r++,i(r<e.length,"Surrogate pair missing trail surrogate.");s=65536+(t<<10)+(e.charCodeAt(r)-56320)}s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=63&s|128):s<65536?(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=63&s|128):(t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=63&s|128)}return t},ee=function(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t};function te(e){return e&&e._delegate?e._delegate:e}},"./node_modules/@formatjs/ecma402-abstract/lib/index.js":function(e,t,n){"use strict";function r(e){return Intl.getCanonicalLocales(e)}function i(e,t){var n=t.zoneNames,r=t.uppercaseLinks,i=e.toUpperCase(),s=n.reduce((function(e,t){return e[t.toUpperCase()]=t,e}),{}),o=r[i]||s[i];return"Etc/UTC"===o||"Etc/GMT"===o?"UTC":o}function s(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function o(e){if(void 0===e)return NaN;if(null===e)return 0;if("boolean"==typeof e)return e?1:0;if("number"==typeof e)return e;if("symbol"==typeof e||"bigint"==typeof e)throw new TypeError("Cannot convert symbol/bigint to number");return Number(e)}function a(e){return isFinite(e)?Math.abs(e)>8640000000000001?NaN:function(e){var t=o(e);if(isNaN(t)||l(t,-0))return 0;if(isFinite(t))return t;var n=Math.floor(Math.abs(t));return t<0&&(n=-n),l(n,-0)?0:n}(e):NaN}function u(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function l(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t}function c(e){return new Array(e)}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function d(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":void 0}n.r(t),n.d(t,{ApplyUnsignedRoundingMode:function(){return Y},ArrayCreate:function(){return c},CanonicalizeLocaleList:function(){return r},CanonicalizeTimeZoneName:function(){return i},CoerceOptionsToObject:function(){return M},CollapseNumberRange:function(){return X},ComputeExponent:function(){return re},ComputeExponentForMagnitude:function(){return Z},CurrencyDigits:function(){return ie},DateFromTime:function(){return T},Day:function(){return m},DayFromYear:function(){return y},DayWithinYear:function(){return w},DaysInYear:function(){return b},FormatApproximately:function(){return se},FormatNumericRange:function(){return ye},FormatNumericRangeToParts:function(){return _e},FormatNumericToParts:function(){return ve},FormatNumericToString:function(){return ne},GetNumberOption:function(){return j},GetOption:function(){return U},GetOptionsObject:function(){return B},GetStringOrBooleanOption:function(){return V},GetUnsignedRoundingMode:function(){return Ee},HasOwnProperty:function(){return h},HourFromTime:function(){return P},InLeapYear:function(){return E},InitializeNumberFormat:function(){return He},IsSanctionedSimpleUnitIdentifier:function(){return G},IsValidTimeZoneName:function(){return $},IsWellFormedCurrencyCode:function(){return W},IsWellFormedUnitIdentifier:function(){return Q},MinFromTime:function(){return x},MonthFromTime:function(){return S},OrdinaryHasInstance:function(){return O},PartitionNumberPattern:function(){return me},PartitionNumberRangePattern:function(){return ge},PartitionPattern:function(){return ze},RangePatternType:function(){return Ge},SANCTIONED_UNITS:function(){return H},SIMPLE_UNITS:function(){return q},SameValue:function(){return l},SecFromTime:function(){return R},SetNumberFormatDigitOptions:function(){return Ue},SetNumberFormatUnitOptions:function(){return Be},SupportedLocales:function(){return qe},TimeClip:function(){return a},TimeFromYear:function(){return _},ToNumber:function(){return o},ToObject:function(){return u},ToRawFixed:function(){return te},ToRawPrecision:function(){return ee},ToString:function(){return s},Type:function(){return d},WeekDay:function(){return g},YearFromTime:function(){return v},_formatToParts:function(){return he},defineProperty:function(){return J.n8},getInternalSlot:function(){return J.Kp},getMagnitude:function(){return J.Vp},getMultiInternalSlots:function(){return J.Cp},invariant:function(){return J.V1},isLiteralPart:function(){return J.pM},isMissingLocaleDataError:function(){return $e},msFromTime:function(){return L},removeUnitNamespace:function(){return z},setInternalSlot:function(){return J._T},setMultiInternalSlots:function(){return J.yB}});var f=864e5;function p(e,t){return e-Math.floor(e/t)*t}function m(e){return Math.floor(e/f)}function g(e){return p(m(e)+4,7)}function y(e){return Date.UTC(e,0)/f}function _(e){return Date.UTC(e,0)}function v(e){return new Date(e).getUTCFullYear()}function b(e){return e%4!=0?365:e%100!=0?366:e%400!=0?365:366}function w(e){return m(e)-y(v(e))}function E(e){return 365===b(v(e))?0:1}function S(e){var t=w(e),n=E(e);if(t>=0&&t<31)return 0;if(t<59+n)return 1;if(t<90+n)return 2;if(t<120+n)return 3;if(t<151+n)return 4;if(t<181+n)return 5;if(t<212+n)return 6;if(t<243+n)return 7;if(t<273+n)return 8;if(t<304+n)return 9;if(t<334+n)return 10;if(t<365+n)return 11;throw new Error("Invalid time")}function T(e){var t=w(e),n=S(e),r=E(e);if(0===n)return t+1;if(1===n)return t-30;if(2===n)return t-58-r;if(3===n)return t-89-r;if(4===n)return t-119-r;if(5===n)return t-150-r;if(6===n)return t-180-r;if(7===n)return t-211-r;if(8===n)return t-242-r;if(9===n)return t-272-r;if(10===n)return t-303-r;if(11===n)return t-333-r;throw new Error("Invalid time")}var C=24,I=60,k=60,A=1e3,N=A*k,D=N*I;function P(e){return p(Math.floor(e/D),C)}function x(e){return p(Math.floor(e/N),I)}function R(e){return p(Math.floor(e/A),k)}function O(e,t,n){if("function"!=typeof e)return!1;if(null==n?void 0:n.boundTargetFunction)return t instanceof(null==n?void 0:n.boundTargetFunction);if("object"!=typeof t)return!1;var r=e.prototype;if("object"!=typeof r)throw new TypeError("OrdinaryHasInstance called on an object with an invalid prototype property.");return Object.prototype.isPrototypeOf.call(r,t)}function L(e){return p(e,A)}function M(e){return void 0===e?Object.create(null):u(e)}function F(e,t,n,r){if(void 0===e)return r;var i=Number(e);if(isNaN(i)||i<t||i>n)throw new RangeError("".concat(i," is outside of range [").concat(t,", ").concat(n,"]"));return Math.floor(i)}function j(e,t,n,r,i){return F(e[t],n,r,i)}function U(e,t,n,r,i){if("object"!=typeof e)throw new TypeError("Options must be an object");var o=e[t];if(void 0!==o){if("boolean"!==n&&"string"!==n)throw new TypeError("invalid type");if("boolean"===n&&(o=Boolean(o)),"string"===n&&(o=s(o)),void 0!==r&&!r.filter((function(e){return e==o})).length)throw new RangeError("".concat(o," is not within ").concat(r.join(", ")));return o}return i}function B(e){if(void 0===e)return Object.create(null);if("object"==typeof e)return e;throw new TypeError("Options must be an object")}function V(e,t,n,r,i,o){var a=e[t];if(void 0===a)return o;if(!0===a)return r;if(!1===Boolean(a))return i;if("true"===(a=s(a))||"false"===a)return o;if(-1===(n||[]).indexOf(a))throw new RangeError("Invalid value ".concat(a));return a}var H=["angle-degree","area-acre","area-hectare","concentr-percent","digital-bit","digital-byte","digital-gigabit","digital-gigabyte","digital-kilobit","digital-kilobyte","digital-megabit","digital-megabyte","digital-petabyte","digital-terabit","digital-terabyte","duration-day","duration-hour","duration-millisecond","duration-minute","duration-month","duration-second","duration-week","duration-year","length-centimeter","length-foot","length-inch","length-kilometer","length-meter","length-mile-scandinavian","length-mile","length-millimeter","length-yard","mass-gram","mass-kilogram","mass-ounce","mass-pound","mass-stone","temperature-celsius","temperature-fahrenheit","volume-fluid-ounce","volume-gallon","volume-liter","volume-milliliter"];function z(e){return e.slice(e.indexOf("-")+1)}var q=H.map(z);function G(e){return q.indexOf(e)>-1}function $(e,t){var n=t.zoneNamesFromData,r=t.uppercaseLinks,i=e.toUpperCase(),s=new Set,o=new Set;return n.map((function(e){return e.toUpperCase()})).forEach((function(e){return s.add(e)})),Object.keys(r).forEach((function(e){o.add(e.toUpperCase()),s.add(r[e].toUpperCase())})),s.has(i)||o.has(i)}var K=/[^A-Z]/;function W(e){return 3===(e=e.replace(/([a-z])/g,(function(e,t){return t.toUpperCase()}))).length&&!K.test(e)}function Q(e){if(G(e=e.replace(/([A-Z])/g,(function(e,t){return t.toLowerCase()}))))return!0;var t=e.split("-per-");if(2!==t.length)return!1;var n=t[0],r=t[1];return!(!G(n)||!G(r))}function Y(e,t,n,r){if(e===t)return t;if(void 0===r)throw new Error("unsignedRoundingMode is mandatory");if("zero"===r)return t;if("infinity"===r)return n;var i=e-t,s=n-e;if(i<s)return t;if(s<i)return n;if(i!==s)throw new Error("Unexpected error");if("half-zero"===r)return t;if("half-infinity"===r)return n;if("half-even"!==r)throw new Error("Unexpected value for unsignedRoundingMode: ".concat(r));return 0===t/(n-t)%2?t:n}function X(e){return e}var J=n("./node_modules/@formatjs/ecma402-abstract/lib/utils.js");function Z(e,t,n){var r=(0,n.getInternalSlots)(e),i=r.notation,s=r.dataLocaleData,o=r.numberingSystem;switch(i){case"standard":return 0;case"scientific":return t;case"engineering":return 3*Math.floor(t/3);default:var a=r.compactDisplay,u=r.style,l=r.currencyDisplay,c=void 0;if("currency"===u&&"name"!==l){c=(s.numbers.currency[o]||s.numbers.currency[s.numbers.nu[0]]).short}else{var h=s.numbers.decimal[o]||s.numbers.decimal[s.numbers.nu[0]];c="long"===a?h.long:h.short}if(!c)return 0;var d=String(Math.pow(10,t)),f=Object.keys(c);if(d<f[0])return 0;if(d>f[f.length-1])return f[f.length-1].length-1;var p=f.indexOf(d);if(-1===p)return 0;var m=f[p];return"0"===c[m].other?0:m.length-c[m].other.match(/0+/)[0].length}}function ee(e,t,n){var r,i,s,o,a=n;if(0===e)r=(0,J.ux)("0",a),i=0,s=0;else{var u=e.toString(),l=u.indexOf("e"),c=u.split("e"),h=c[0],d=c[1],f=h.replace(".","");if(l>=0&&f.length<=a)i=+d,r=f+(0,J.ux)("0",a-f.length),s=e;else{var p=(i=(0,J.Vp)(e))-a+1,m=Math.round(y(e,p));y(m,a-1)>=10&&(i+=1,m=Math.floor(m/10)),r=m.toString(),s=y(m,a-1-i)}}if(i>=a-1?(r+=(0,J.ux)("0",i-a+1),o=i+1):i>=0?(r="".concat(r.slice(0,i+1),".").concat(r.slice(i+1)),o=i+1):(r="0.".concat((0,J.ux)("0",-i-1)).concat(r),o=1),r.indexOf(".")>=0&&n>t){for(var g=n-t;g>0&&"0"===r[r.length-1];)r=r.slice(0,-1),g--;"."===r[r.length-1]&&(r=r.slice(0,-1))}return{formattedString:r,roundedNumber:s,integerDigitsCount:o};function y(e,t){return t<0?e*Math.pow(10,-t):e/Math.pow(10,t)}}function te(e,t,n){var r,i,s=n,o=Math.round(e*Math.pow(10,s)),a=o/Math.pow(10,s);if(o<1e21)r=o.toString();else{var u=(r=o.toString()).split("e"),l=u[0],c=u[1];r=l.replace(".",""),r+=(0,J.ux)("0",Math.max(+c-r.length+1,0))}if(0!==s){var h=r.length;if(h<=s)r=(0,J.ux)("0",s+1-h)+r,h=s+1;var d=r.slice(0,h-s),f=r.slice(h-s);r="".concat(d,".").concat(f),i=d.length}else i=r.length;for(var p=n-t;p>0&&"0"===r[r.length-1];)r=r.slice(0,-1),p--;return"."===r[r.length-1]&&(r=r.slice(0,-1)),{formattedString:r,roundedNumber:a,integerDigitsCount:i}}function ne(e,t){var n,r=t<0||l(t,-0);switch(r&&(t=-t),e.roundingType){case"significantDigits":n=ee(t,e.minimumSignificantDigits,e.maximumSignificantDigits);break;case"fractionDigits":n=te(t,e.minimumFractionDigits,e.maximumFractionDigits);break;default:(n=ee(t,1,2)).integerDigitsCount>1&&(n=te(t,0,0))}t=n.roundedNumber;var i=n.formattedString,s=n.integerDigitsCount,o=e.minimumIntegerDigits;s<o&&(i=(0,J.ux)("0",o-s)+i);return r&&(t=-t),{roundedNumber:t,formattedString:i}}function re(e,t,n){var r=n.getInternalSlots;if(0===t)return[0,0];t<0&&(t=-t);var i=(0,J.Vp)(t),s=Z(e,i,{getInternalSlots:r});t=s<0?t*Math.pow(10,-s):t/Math.pow(10,s);var o=ne(r(e),t);return 0===o.roundedNumber||(0,J.Vp)(o.roundedNumber)===i-s?[s,i]:[Z(e,i+1,{getInternalSlots:r}),i+1]}function ie(e,t){var n=t.currencyDigitsData;return h(n,e)?n[e]:2}function se(e,t,n){var r=(0,n.getInternalSlots)(e),i=r.dataLocaleData.numbers.symbols[r.numberingSystem].approximatelySign;return t.push({type:"approximatelySign",value:i}),t}var oe={adlm:["𞥐","𞥑","𞥒","𞥓","𞥔","𞥕","𞥖","𞥗","𞥘","𞥙"],ahom:["𑜰","𑜱","𑜲","𑜳","𑜴","𑜵","𑜶","𑜷","𑜸","𑜹"],arab:["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],arabext:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],bali:["᭐","᭑","᭒","᭓","᭔","᭕","᭖","᭗","᭘","᭙"],beng:["০","১","২","৩","৪","৫","৬","৭","৮","৯"],bhks:["𑱐","𑱑","𑱒","𑱓","𑱔","𑱕","𑱖","𑱗","𑱘","𑱙"],brah:["𑁦","𑁧","𑁨","𑁩","𑁪","𑁫","𑁬","𑁭","𑁮","𑁯"],cakm:["𑄶","𑄷","𑄸","𑄹","𑄺","𑄻","𑄼","𑄽","𑄾","𑄿"],cham:["꩐","꩑","꩒","꩓","꩔","꩕","꩖","꩗","꩘","꩙"],deva:["०","१","२","३","४","५","६","७","८","९"],diak:["𑥐","𑥑","𑥒","𑥓","𑥔","𑥕","𑥖","𑥗","𑥘","𑥙"],fullwide:["０","１","２","３","４","５","６","７","８","９"],gong:["𑶠","𑶡","𑶢","𑶣","𑶤","𑶥","𑶦","𑶧","𑶨","𑶩"],gonm:["𑵐","𑵑","𑵒","𑵓","𑵔","𑵕","𑵖","𑵗","𑵘","𑵙"],gujr:["૦","૧","૨","૩","૪","૫","૬","૭","૮","૯"],guru:["੦","੧","੨","੩","੪","੫","੬","੭","੮","੯"],hanidec:["〇","一","二","三","四","五","六","七","八","九"],hmng:["𖭐","𖭑","𖭒","𖭓","𖭔","𖭕","𖭖","𖭗","𖭘","𖭙"],hmnp:["𞅀","𞅁","𞅂","𞅃","𞅄","𞅅","𞅆","𞅇","𞅈","𞅉"],java:["꧐","꧑","꧒","꧓","꧔","꧕","꧖","꧗","꧘","꧙"],kali:["꤀","꤁","꤂","꤃","꤄","꤅","꤆","꤇","꤈","꤉"],khmr:["០","១","២","៣","៤","៥","៦","៧","៨","៩"],knda:["೦","೧","೨","೩","೪","೫","೬","೭","೮","೯"],lana:["᪀","᪁","᪂","᪃","᪄","᪅","᪆","᪇","᪈","᪉"],lanatham:["᪐","᪑","᪒","᪓","᪔","᪕","᪖","᪗","᪘","᪙"],laoo:["໐","໑","໒","໓","໔","໕","໖","໗","໘","໙"],lepc:["᪐","᪑","᪒","᪓","᪔","᪕","᪖","᪗","᪘","᪙"],limb:["᥆","᥇","᥈","᥉","᥊","᥋","᥌","᥍","᥎","᥏"],mathbold:["𝟎","𝟏","𝟐","𝟑","𝟒","𝟓","𝟔","𝟕","𝟖","𝟗"],mathdbl:["𝟘","𝟙","𝟚","𝟛","𝟜","𝟝","𝟞","𝟟","𝟠","𝟡"],mathmono:["𝟶","𝟷","𝟸","𝟹","𝟺","𝟻","𝟼","𝟽","𝟾","𝟿"],mathsanb:["𝟬","𝟭","𝟮","𝟯","𝟰","𝟱","𝟲","𝟳","𝟴","𝟵"],mathsans:["𝟢","𝟣","𝟤","𝟥","𝟦","𝟧","𝟨","𝟩","𝟪","𝟫"],mlym:["൦","൧","൨","൩","൪","൫","൬","൭","൮","൯"],modi:["𑙐","𑙑","𑙒","𑙓","𑙔","𑙕","𑙖","𑙗","𑙘","𑙙"],mong:["᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"],mroo:["𖩠","𖩡","𖩢","𖩣","𖩤","𖩥","𖩦","𖩧","𖩨","𖩩"],mtei:["꯰","꯱","꯲","꯳","꯴","꯵","꯶","꯷","꯸","꯹"],mymr:["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],mymrshan:["႐","႑","႒","႓","႔","႕","႖","႗","႘","႙"],mymrtlng:["꧰","꧱","꧲","꧳","꧴","꧵","꧶","꧷","꧸","꧹"],newa:["𑑐","𑑑","𑑒","𑑓","𑑔","𑑕","𑑖","𑑗","𑑘","𑑙"],nkoo:["߀","߁","߂","߃","߄","߅","߆","߇","߈","߉"],olck:["᱐","᱑","᱒","᱓","᱔","᱕","᱖","᱗","᱘","᱙"],orya:["୦","୧","୨","୩","୪","୫","୬","୭","୮","୯"],osma:["𐒠","𐒡","𐒢","𐒣","𐒤","𐒥","𐒦","𐒧","𐒨","𐒩"],rohg:["𐴰","𐴱","𐴲","𐴳","𐴴","𐴵","𐴶","𐴷","𐴸","𐴹"],saur:["꣐","꣑","꣒","꣓","꣔","꣕","꣖","꣗","꣘","꣙"],segment:["🯰","🯱","🯲","🯳","🯴","🯵","🯶","🯷","🯸","🯹"],shrd:["𑇐","𑇑","𑇒","𑇓","𑇔","𑇕","𑇖","𑇗","𑇘","𑇙"],sind:["𑋰","𑋱","𑋲","𑋳","𑋴","𑋵","𑋶","𑋷","𑋸","𑋹"],sinh:["෦","෧","෨","෩","෪","෫","෬","෭","෮","෯"],sora:["𑃰","𑃱","𑃲","𑃳","𑃴","𑃵","𑃶","𑃷","𑃸","𑃹"],sund:["᮰","᮱","᮲","᮳","᮴","᮵","᮶","᮷","᮸","᮹"],takr:["𑛀","𑛁","𑛂","𑛃","𑛄","𑛅","𑛆","𑛇","𑛈","𑛉"],talu:["᧐","᧑","᧒","᧓","᧔","᧕","᧖","᧗","᧘","᧙"],tamldec:["௦","௧","௨","௩","௪","௫","௬","௭","௮","௯"],telu:["౦","౧","౨","౩","౪","౫","౬","౭","౮","౯"],thai:["๐","๑","๒","๓","๔","๕","๖","๗","๘","๙"],tibt:["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"],tirh:["𑓐","𑓑","𑓒","𑓓","𑓔","𑓕","𑓖","𑓗","𑓘","𑓙"],vaii:["ᘠ","ᘡ","ᘢ","ᘣ","ᘤ","ᘥ","ᘦ","ᘧ","ᘨ","ᘩ"],wara:["𑣠","𑣡","𑣢","𑣣","𑣤","𑣥","𑣦","𑣧","𑣨","𑣩"],wcho:["𞋰","𞋱","𞋲","𞋳","𞋴","𞋵","𞋶","𞋷","𞋸","𞋹"]},ae=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/,ue=new RegExp("^".concat(ae.source)),le=new RegExp("".concat(ae.source,"$")),ce=/[#0](?:[\.,][#0]+)*/g;function he(e,t,n,r){var i,s,o=e.sign,a=e.exponent,u=e.magnitude,l=r.notation,c=r.style,h=r.numberingSystem,d=t.numbers.nu[0],f=null;if("compact"===l&&u&&(f=function(e,t,n,r,i,s,o){var a,u,l=e.roundedNumber,c=e.sign,h=e.magnitude,d=String(Math.pow(10,h)),f=n.numbers.nu[0];if("currency"===r&&"name"!==s){var p=null===(a=((m=n.numbers.currency)[o]||m[f]).short)||void 0===a?void 0:a[d];if(!p)return null;u=pe(t,l,p)}else{var m,g=((m=n.numbers.decimal)[o]||m[f])[i][d];if(!g)return null;u=pe(t,l,g)}if("0"===u)return null;return u=fe(u,c).replace(/([^\s;\-\+\d¤]+)/g,"{c:$1}").replace(/0+/,"0"),u}(e,n,t,c,r.compactDisplay,r.currencyDisplay,h)),"currency"===c&&"name"!==r.currencyDisplay){var p=t.currencies[r.currency];if(p)switch(r.currencyDisplay){case"code":i=r.currency;break;case"symbol":i=p.symbol;break;default:i=p.narrow}else i=r.currency}if(f)s=f;else if("decimal"===c||"unit"===c||"currency"===c&&"name"===r.currencyDisplay)s=fe((t.numbers.decimal[h]||t.numbers.decimal[d]).standard,o);else if("currency"===c){s=fe((g=t.numbers.currency[h]||t.numbers.currency[d])[r.currencySign],o)}else{s=fe(t.numbers.percent[h]||t.numbers.percent[d],o)}var m=ce.exec(s)[0];if(s=s.replace(ce,"{0}").replace(/'(.)'/g,"$1"),"currency"===c&&"name"!==r.currencyDisplay){var g,y=(g=t.numbers.currency[h]||t.numbers.currency[d]).currencySpacing.afterInsertBetween;y&&!le.test(i)&&(s=s.replace("¤{0}","¤".concat(y,"{0}")));var _=g.currencySpacing.beforeInsertBetween;_&&!ue.test(i)&&(s=s.replace("{0}¤","{0}".concat(_,"¤")))}for(var v=s.split(/({c:[^}]+}|\{0\}|[¤%\-\+])/g),b=[],w=t.numbers.symbols[h]||t.numbers.symbols[d],E=0,S=v;E<S.length;E++){if(H=S[E])switch(H){case"{0}":b.push.apply(b,de(w,e,l,a,h,!f&&Boolean(r.useGrouping),m));break;case"-":b.push({type:"minusSign",value:w.minusSign});break;case"+":b.push({type:"plusSign",value:w.plusSign});break;case"%":b.push({type:"percentSign",value:w.percentSign});break;case"¤":b.push({type:"currency",value:i});break;default:/^\{c:/.test(H)?b.push({type:"compact",value:H.substring(3,H.length-1)}):b.push({type:"literal",value:H})}}switch(c){case"currency":if("name"===r.currencyDisplay){var T=(t.numbers.currency[h]||t.numbers.currency[d]).unitPattern,C=void 0,I=t.currencies[r.currency];C=I?pe(n,e.roundedNumber*Math.pow(10,a),I.displayName):r.currency;for(var k=[],A=0,N=T.split(/(\{[01]\})/g);A<N.length;A++){switch(H=N[A]){case"{0}":k.push.apply(k,b);break;case"{1}":k.push({type:"currency",value:C});break;default:H&&k.push({type:"literal",value:H})}}return k}return b;case"unit":var D=r.unit,P=r.unitDisplay,x=t.units.simple[D];T=void 0;if(x)T=pe(n,e.roundedNumber*Math.pow(10,a),t.units.simple[D][P]);else{var R=D.split("-per-"),O=R[0],L=R[1];x=t.units.simple[O];var M=pe(n,e.roundedNumber*Math.pow(10,a),t.units.simple[O][P]),F=t.units.simple[L].perUnit[P];if(F)T=F.replace("{0}",M);else{var j=t.units.compound.per[P],U=pe(n,1,t.units.simple[L][P]);T=T=j.replace("{0}",M).replace("{1}",U.replace("{0}",""))}}k=[];for(var B=0,V=T.split(/(\s*\{0\}\s*)/);B<V.length;B++){var H=V[B],z=/^(\s*)\{0\}(\s*)$/.exec(H);z?(z[1]&&k.push({type:"literal",value:z[1]}),k.push.apply(k,b),z[2]&&k.push({type:"literal",value:z[2]})):H&&k.push({type:"unit",value:H})}return k;default:return b}}function de(e,t,n,r,i,s,o){var a=[],u=t.formattedString,l=t.roundedNumber;if(isNaN(l))return[{type:"nan",value:u}];if(!isFinite(l))return[{type:"infinity",value:u}];var c=oe[i];c&&(u=u.replace(/\d/g,(function(e){return c[+e]||e})));var h,d,f=u.indexOf(".");if(f>0?(h=u.slice(0,f),d=u.slice(f+1)):h=u,s&&("compact"!==n||l>=1e4)){var p=e.group,m=[],g=o.split(".")[0].split(","),y=3,_=3;g.length>1&&(y=g[g.length-1].length),g.length>2&&(_=g[g.length-2].length);var v=h.length-y;if(v>0){for(m.push(h.slice(v,v+y)),v-=_;v>0;v-=_)m.push(h.slice(v,v+_));m.push(h.slice(0,v+_))}else m.push(h);for(;m.length>0;){var b=m.pop();a.push({type:"integer",value:b}),m.length>0&&a.push({type:"group",value:p})}}else a.push({type:"integer",value:h});if(void 0!==d&&a.push({type:"decimal",value:e.decimal},{type:"fraction",value:d}),("scientific"===n||"engineering"===n)&&isFinite(l)){a.push({type:"exponentSeparator",value:e.exponential}),r<0&&(a.push({type:"exponentMinusSign",value:e.minusSign}),r=-r);var w=te(r,0,0);a.push({type:"exponentInteger",value:w.formattedString})}return a}function fe(e,t){e.indexOf(";")<0&&(e="".concat(e,";-").concat(e));var n=e.split(";"),r=n[0],i=n[1];switch(t){case 0:return r;case-1:return i;default:return i.indexOf("-")>=0?i.replace(/-/g,"+"):"+".concat(r)}}function pe(e,t,n){return n[e.select(t)]||n.other}function me(e,t,n){var r,i,s,o=n.getInternalSlots,a=o(e),u=a.pl,c=a.dataLocaleData,h=a.numberingSystem,d=c.numbers.symbols[h]||c.numbers.symbols[c.numbers.nu[0]],f=0,p=0;if(isNaN(t))i=d.nan;else if(t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)i=d.infinity;else{if(!l(t,-0)){if(!isFinite(t))throw new Error("Input must be a mathematical value");"percent"==a.style&&(t*=100),p=(r=re(e,t,{getInternalSlots:o}))[0],f=r[1],t=p<0?t*Math.pow(10,-p):t/Math.pow(10,p)}var m=ne(a,t);i=m.formattedString,t=m.roundedNumber}switch(a.signDisplay){case"never":s=0;break;case"auto":s=l(t,0)||t>0||isNaN(t)?0:-1;break;case"always":s=l(t,0)||t>0||isNaN(t)?1:-1;break;default:s=0===t||isNaN(t)?0:t>0?1:-1}return he({roundedNumber:t,formattedString:i,exponent:p,magnitude:f,sign:s},a.dataLocaleData,u,a)}function ge(e,t,n,r){var i=r.getInternalSlots;if(isNaN(t)||isNaN(n))throw new RangeError("Input must be a number");var s=[],o=me(e,t,{getInternalSlots:i}),a=me(e,n,{getInternalSlots:i});if(o===a)return se(e,o,{getInternalSlots:i});for(var u=0,l=o;u<l.length;u++){l[u].source="startRange"}s=s.concat(o);var c=i(e),h=c.dataLocaleData.numbers.symbols[c.numberingSystem];s.push({type:"literal",value:h.rangeSign,source:"shared"});for(var d=0,f=a;d<f.length;d++){f[d].source="endRange"}return s=s.concat(a)}function ye(e,t,n,r){return ge(e,t,n,{getInternalSlots:r.getInternalSlots}).map((function(e){return e.value})).join("")}function _e(e,t,n,r){return ge(e,t,n,{getInternalSlots:r.getInternalSlots}).map((function(e,t){return{type:e.type,value:e.value,source:e.source,result:t.toString()}}))}function ve(e,t,n){for(var r=me(e,t,n),i=c(0),s=0,o=r;s<o.length;s++){var a=o[s];i.push({type:a.type,value:a.value})}return i}var be={ceil:"zero",floor:"infinity",expand:"infinity",trunc:"zero",halfCeil:"half-zero",halfFloor:"half-infinity",halfExpand:"half-infinity",halfTrunc:"half-zero",halfEven:"half-even"},we={ceil:"infinity",floor:"zero",expand:"infinity",trunc:"zero",halfCeil:"half-infinity",halfFloor:"half-zero",halfExpand:"half-infinity",halfTrunc:"half-zero",halfEven:"half-even"};function Ee(e,t){return t?be[e]:we[e]}var Se=n("./node_modules/tslib/tslib.es6.mjs"),Te={supplemental:{languageMatching:{"written-new":[{paradigmLocales:{_locales:"en en_GB es es_419 pt_BR pt_PT"}},{$enUS:{_value:"AS+CA+GU+MH+MP+PH+PR+UM+US+VI"}},{$cnsar:{_value:"HK+MO"}},{$americas:{_value:"019"}},{$maghreb:{_value:"MA+DZ+TN+LY+MR+EH"}},{no:{_desired:"nb",_distance:"1"}},{bs:{_desired:"hr",_distance:"4"}},{bs:{_desired:"sh",_distance:"4"}},{hr:{_desired:"sh",_distance:"4"}},{sr:{_desired:"sh",_distance:"4"}},{aa:{_desired:"ssy",_distance:"4"}},{de:{_desired:"gsw",_distance:"4",_oneway:"true"}},{de:{_desired:"lb",_distance:"4",_oneway:"true"}},{no:{_desired:"da",_distance:"8"}},{nb:{_desired:"da",_distance:"8"}},{ru:{_desired:"ab",_distance:"30",_oneway:"true"}},{en:{_desired:"ach",_distance:"30",_oneway:"true"}},{nl:{_desired:"af",_distance:"20",_oneway:"true"}},{en:{_desired:"ak",_distance:"30",_oneway:"true"}},{en:{_desired:"am",_distance:"30",_oneway:"true"}},{es:{_desired:"ay",_distance:"20",_oneway:"true"}},{ru:{_desired:"az",_distance:"30",_oneway:"true"}},{ur:{_desired:"bal",_distance:"20",_oneway:"true"}},{ru:{_desired:"be",_distance:"20",_oneway:"true"}},{en:{_desired:"bem",_distance:"30",_oneway:"true"}},{hi:{_desired:"bh",_distance:"30",_oneway:"true"}},{en:{_desired:"bn",_distance:"30",_oneway:"true"}},{zh:{_desired:"bo",_distance:"20",_oneway:"true"}},{fr:{_desired:"br",_distance:"20",_oneway:"true"}},{es:{_desired:"ca",_distance:"20",_oneway:"true"}},{fil:{_desired:"ceb",_distance:"30",_oneway:"true"}},{en:{_desired:"chr",_distance:"20",_oneway:"true"}},{ar:{_desired:"ckb",_distance:"30",_oneway:"true"}},{fr:{_desired:"co",_distance:"20",_oneway:"true"}},{fr:{_desired:"crs",_distance:"20",_oneway:"true"}},{sk:{_desired:"cs",_distance:"20"}},{en:{_desired:"cy",_distance:"20",_oneway:"true"}},{en:{_desired:"ee",_distance:"30",_oneway:"true"}},{en:{_desired:"eo",_distance:"30",_oneway:"true"}},{es:{_desired:"eu",_distance:"20",_oneway:"true"}},{da:{_desired:"fo",_distance:"20",_oneway:"true"}},{nl:{_desired:"fy",_distance:"20",_oneway:"true"}},{en:{_desired:"ga",_distance:"20",_oneway:"true"}},{en:{_desired:"gaa",_distance:"30",_oneway:"true"}},{en:{_desired:"gd",_distance:"20",_oneway:"true"}},{es:{_desired:"gl",_distance:"20",_oneway:"true"}},{es:{_desired:"gn",_distance:"20",_oneway:"true"}},{hi:{_desired:"gu",_distance:"30",_oneway:"true"}},{en:{_desired:"ha",_distance:"30",_oneway:"true"}},{en:{_desired:"haw",_distance:"20",_oneway:"true"}},{fr:{_desired:"ht",_distance:"20",_oneway:"true"}},{ru:{_desired:"hy",_distance:"30",_oneway:"true"}},{en:{_desired:"ia",_distance:"30",_oneway:"true"}},{en:{_desired:"ig",_distance:"30",_oneway:"true"}},{en:{_desired:"is",_distance:"20",_oneway:"true"}},{id:{_desired:"jv",_distance:"20",_oneway:"true"}},{en:{_desired:"ka",_distance:"30",_oneway:"true"}},{fr:{_desired:"kg",_distance:"30",_oneway:"true"}},{ru:{_desired:"kk",_distance:"30",_oneway:"true"}},{en:{_desired:"km",_distance:"30",_oneway:"true"}},{en:{_desired:"kn",_distance:"30",_oneway:"true"}},{en:{_desired:"kri",_distance:"30",_oneway:"true"}},{tr:{_desired:"ku",_distance:"30",_oneway:"true"}},{ru:{_desired:"ky",_distance:"30",_oneway:"true"}},{it:{_desired:"la",_distance:"20",_oneway:"true"}},{en:{_desired:"lg",_distance:"30",_oneway:"true"}},{fr:{_desired:"ln",_distance:"30",_oneway:"true"}},{en:{_desired:"lo",_distance:"30",_oneway:"true"}},{en:{_desired:"loz",_distance:"30",_oneway:"true"}},{fr:{_desired:"lua",_distance:"30",_oneway:"true"}},{hi:{_desired:"mai",_distance:"20",_oneway:"true"}},{en:{_desired:"mfe",_distance:"30",_oneway:"true"}},{fr:{_desired:"mg",_distance:"30",_oneway:"true"}},{en:{_desired:"mi",_distance:"20",_oneway:"true"}},{en:{_desired:"ml",_distance:"30",_oneway:"true"}},{ru:{_desired:"mn",_distance:"30",_oneway:"true"}},{hi:{_desired:"mr",_distance:"30",_oneway:"true"}},{id:{_desired:"ms",_distance:"30",_oneway:"true"}},{en:{_desired:"mt",_distance:"30",_oneway:"true"}},{en:{_desired:"my",_distance:"30",_oneway:"true"}},{en:{_desired:"ne",_distance:"30",_oneway:"true"}},{nb:{_desired:"nn",_distance:"20"}},{no:{_desired:"nn",_distance:"20"}},{en:{_desired:"nso",_distance:"30",_oneway:"true"}},{en:{_desired:"ny",_distance:"30",_oneway:"true"}},{en:{_desired:"nyn",_distance:"30",_oneway:"true"}},{fr:{_desired:"oc",_distance:"20",_oneway:"true"}},{en:{_desired:"om",_distance:"30",_oneway:"true"}},{en:{_desired:"or",_distance:"30",_oneway:"true"}},{en:{_desired:"pa",_distance:"30",_oneway:"true"}},{en:{_desired:"pcm",_distance:"20",_oneway:"true"}},{en:{_desired:"ps",_distance:"30",_oneway:"true"}},{es:{_desired:"qu",_distance:"30",_oneway:"true"}},{de:{_desired:"rm",_distance:"20",_oneway:"true"}},{en:{_desired:"rn",_distance:"30",_oneway:"true"}},{fr:{_desired:"rw",_distance:"30",_oneway:"true"}},{hi:{_desired:"sa",_distance:"30",_oneway:"true"}},{en:{_desired:"sd",_distance:"30",_oneway:"true"}},{en:{_desired:"si",_distance:"30",_oneway:"true"}},{en:{_desired:"sn",_distance:"30",_oneway:"true"}},{en:{_desired:"so",_distance:"30",_oneway:"true"}},{en:{_desired:"sq",_distance:"30",_oneway:"true"}},{en:{_desired:"st",_distance:"30",_oneway:"true"}},{id:{_desired:"su",_distance:"20",_oneway:"true"}},{en:{_desired:"sw",_distance:"30",_oneway:"true"}},{en:{_desired:"ta",_distance:"30",_oneway:"true"}},{en:{_desired:"te",_distance:"30",_oneway:"true"}},{ru:{_desired:"tg",_distance:"30",_oneway:"true"}},{en:{_desired:"ti",_distance:"30",_oneway:"true"}},{ru:{_desired:"tk",_distance:"30",_oneway:"true"}},{en:{_desired:"tlh",_distance:"30",_oneway:"true"}},{en:{_desired:"tn",_distance:"30",_oneway:"true"}},{en:{_desired:"to",_distance:"30",_oneway:"true"}},{ru:{_desired:"tt",_distance:"30",_oneway:"true"}},{en:{_desired:"tum",_distance:"30",_oneway:"true"}},{zh:{_desired:"ug",_distance:"20",_oneway:"true"}},{ru:{_desired:"uk",_distance:"20",_oneway:"true"}},{en:{_desired:"ur",_distance:"30",_oneway:"true"}},{ru:{_desired:"uz",_distance:"30",_oneway:"true"}},{fr:{_desired:"wo",_distance:"30",_oneway:"true"}},{en:{_desired:"xh",_distance:"30",_oneway:"true"}},{en:{_desired:"yi",_distance:"30",_oneway:"true"}},{en:{_desired:"yo",_distance:"30",_oneway:"true"}},{zh:{_desired:"za",_distance:"20",_oneway:"true"}},{en:{_desired:"zu",_distance:"30",_oneway:"true"}},{ar:{_desired:"aao",_distance:"10",_oneway:"true"}},{ar:{_desired:"abh",_distance:"10",_oneway:"true"}},{ar:{_desired:"abv",_distance:"10",_oneway:"true"}},{ar:{_desired:"acm",_distance:"10",_oneway:"true"}},{ar:{_desired:"acq",_distance:"10",_oneway:"true"}},{ar:{_desired:"acw",_distance:"10",_oneway:"true"}},{ar:{_desired:"acx",_distance:"10",_oneway:"true"}},{ar:{_desired:"acy",_distance:"10",_oneway:"true"}},{ar:{_desired:"adf",_distance:"10",_oneway:"true"}},{ar:{_desired:"aeb",_distance:"10",_oneway:"true"}},{ar:{_desired:"aec",_distance:"10",_oneway:"true"}},{ar:{_desired:"afb",_distance:"10",_oneway:"true"}},{ar:{_desired:"ajp",_distance:"10",_oneway:"true"}},{ar:{_desired:"apc",_distance:"10",_oneway:"true"}},{ar:{_desired:"apd",_distance:"10",_oneway:"true"}},{ar:{_desired:"arq",_distance:"10",_oneway:"true"}},{ar:{_desired:"ars",_distance:"10",_oneway:"true"}},{ar:{_desired:"ary",_distance:"10",_oneway:"true"}},{ar:{_desired:"arz",_distance:"10",_oneway:"true"}},{ar:{_desired:"auz",_distance:"10",_oneway:"true"}},{ar:{_desired:"avl",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayh",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayl",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayn",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayp",_distance:"10",_oneway:"true"}},{ar:{_desired:"bbz",_distance:"10",_oneway:"true"}},{ar:{_desired:"pga",_distance:"10",_oneway:"true"}},{ar:{_desired:"shu",_distance:"10",_oneway:"true"}},{ar:{_desired:"ssh",_distance:"10",_oneway:"true"}},{az:{_desired:"azb",_distance:"10",_oneway:"true"}},{et:{_desired:"vro",_distance:"10",_oneway:"true"}},{ff:{_desired:"ffm",_distance:"10",_oneway:"true"}},{ff:{_desired:"fub",_distance:"10",_oneway:"true"}},{ff:{_desired:"fue",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuf",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuh",_distance:"10",_oneway:"true"}},{ff:{_desired:"fui",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuq",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuv",_distance:"10",_oneway:"true"}},{gn:{_desired:"gnw",_distance:"10",_oneway:"true"}},{gn:{_desired:"gui",_distance:"10",_oneway:"true"}},{gn:{_desired:"gun",_distance:"10",_oneway:"true"}},{gn:{_desired:"nhd",_distance:"10",_oneway:"true"}},{iu:{_desired:"ikt",_distance:"10",_oneway:"true"}},{kln:{_desired:"enb",_distance:"10",_oneway:"true"}},{kln:{_desired:"eyo",_distance:"10",_oneway:"true"}},{kln:{_desired:"niq",_distance:"10",_oneway:"true"}},{kln:{_desired:"oki",_distance:"10",_oneway:"true"}},{kln:{_desired:"pko",_distance:"10",_oneway:"true"}},{kln:{_desired:"sgc",_distance:"10",_oneway:"true"}},{kln:{_desired:"tec",_distance:"10",_oneway:"true"}},{kln:{_desired:"tuy",_distance:"10",_oneway:"true"}},{kok:{_desired:"gom",_distance:"10",_oneway:"true"}},{kpe:{_desired:"gkp",_distance:"10",_oneway:"true"}},{luy:{_desired:"ida",_distance:"10",_oneway:"true"}},{luy:{_desired:"lkb",_distance:"10",_oneway:"true"}},{luy:{_desired:"lko",_distance:"10",_oneway:"true"}},{luy:{_desired:"lks",_distance:"10",_oneway:"true"}},{luy:{_desired:"lri",_distance:"10",_oneway:"true"}},{luy:{_desired:"lrm",_distance:"10",_oneway:"true"}},{luy:{_desired:"lsm",_distance:"10",_oneway:"true"}},{luy:{_desired:"lto",_distance:"10",_oneway:"true"}},{luy:{_desired:"lts",_distance:"10",_oneway:"true"}},{luy:{_desired:"lwg",_distance:"10",_oneway:"true"}},{luy:{_desired:"nle",_distance:"10",_oneway:"true"}},{luy:{_desired:"nyd",_distance:"10",_oneway:"true"}},{luy:{_desired:"rag",_distance:"10",_oneway:"true"}},{lv:{_desired:"ltg",_distance:"10",_oneway:"true"}},{mg:{_desired:"bhr",_distance:"10",_oneway:"true"}},{mg:{_desired:"bjq",_distance:"10",_oneway:"true"}},{mg:{_desired:"bmm",_distance:"10",_oneway:"true"}},{mg:{_desired:"bzc",_distance:"10",_oneway:"true"}},{mg:{_desired:"msh",_distance:"10",_oneway:"true"}},{mg:{_desired:"skg",_distance:"10",_oneway:"true"}},{mg:{_desired:"tdx",_distance:"10",_oneway:"true"}},{mg:{_desired:"tkg",_distance:"10",_oneway:"true"}},{mg:{_desired:"txy",_distance:"10",_oneway:"true"}},{mg:{_desired:"xmv",_distance:"10",_oneway:"true"}},{mg:{_desired:"xmw",_distance:"10",_oneway:"true"}},{mn:{_desired:"mvf",_distance:"10",_oneway:"true"}},{ms:{_desired:"bjn",_distance:"10",_oneway:"true"}},{ms:{_desired:"btj",_distance:"10",_oneway:"true"}},{ms:{_desired:"bve",_distance:"10",_oneway:"true"}},{ms:{_desired:"bvu",_distance:"10",_oneway:"true"}},{ms:{_desired:"coa",_distance:"10",_oneway:"true"}},{ms:{_desired:"dup",_distance:"10",_oneway:"true"}},{ms:{_desired:"hji",_distance:"10",_oneway:"true"}},{ms:{_desired:"id",_distance:"10",_oneway:"true"}},{ms:{_desired:"jak",_distance:"10",_oneway:"true"}},{ms:{_desired:"jax",_distance:"10",_oneway:"true"}},{ms:{_desired:"kvb",_distance:"10",_oneway:"true"}},{ms:{_desired:"kvr",_distance:"10",_oneway:"true"}},{ms:{_desired:"kxd",_distance:"10",_oneway:"true"}},{ms:{_desired:"lce",_distance:"10",_oneway:"true"}},{ms:{_desired:"lcf",_distance:"10",_oneway:"true"}},{ms:{_desired:"liw",_distance:"10",_oneway:"true"}},{ms:{_desired:"max",_distance:"10",_oneway:"true"}},{ms:{_desired:"meo",_distance:"10",_oneway:"true"}},{ms:{_desired:"mfa",_distance:"10",_oneway:"true"}},{ms:{_desired:"mfb",_distance:"10",_oneway:"true"}},{ms:{_desired:"min",_distance:"10",_oneway:"true"}},{ms:{_desired:"mqg",_distance:"10",_oneway:"true"}},{ms:{_desired:"msi",_distance:"10",_oneway:"true"}},{ms:{_desired:"mui",_distance:"10",_oneway:"true"}},{ms:{_desired:"orn",_distance:"10",_oneway:"true"}},{ms:{_desired:"ors",_distance:"10",_oneway:"true"}},{ms:{_desired:"pel",_distance:"10",_oneway:"true"}},{ms:{_desired:"pse",_distance:"10",_oneway:"true"}},{ms:{_desired:"tmw",_distance:"10",_oneway:"true"}},{ms:{_desired:"urk",_distance:"10",_oneway:"true"}},{ms:{_desired:"vkk",_distance:"10",_oneway:"true"}},{ms:{_desired:"vkt",_distance:"10",_oneway:"true"}},{ms:{_desired:"xmm",_distance:"10",_oneway:"true"}},{ms:{_desired:"zlm",_distance:"10",_oneway:"true"}},{ms:{_desired:"zmi",_distance:"10",_oneway:"true"}},{ne:{_desired:"dty",_distance:"10",_oneway:"true"}},{om:{_desired:"gax",_distance:"10",_oneway:"true"}},{om:{_desired:"hae",_distance:"10",_oneway:"true"}},{om:{_desired:"orc",_distance:"10",_oneway:"true"}},{or:{_desired:"spv",_distance:"10",_oneway:"true"}},{ps:{_desired:"pbt",_distance:"10",_oneway:"true"}},{ps:{_desired:"pst",_distance:"10",_oneway:"true"}},{qu:{_desired:"qub",_distance:"10",_oneway:"true"}},{qu:{_desired:"qud",_distance:"10",_oneway:"true"}},{qu:{_desired:"quf",_distance:"10",_oneway:"true"}},{qu:{_desired:"qug",_distance:"10",_oneway:"true"}},{qu:{_desired:"quh",_distance:"10",_oneway:"true"}},{qu:{_desired:"quk",_distance:"10",_oneway:"true"}},{qu:{_desired:"qul",_distance:"10",_oneway:"true"}},{qu:{_desired:"qup",_distance:"10",_oneway:"true"}},{qu:{_desired:"qur",_distance:"10",_oneway:"true"}},{qu:{_desired:"qus",_distance:"10",_oneway:"true"}},{qu:{_desired:"quw",_distance:"10",_oneway:"true"}},{qu:{_desired:"qux",_distance:"10",_oneway:"true"}},{qu:{_desired:"quy",_distance:"10",_oneway:"true"}},{qu:{_desired:"qva",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvc",_distance:"10",_oneway:"true"}},{qu:{_desired:"qve",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvh",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvi",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvj",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvl",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvm",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvn",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvo",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvp",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvs",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvw",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvz",_distance:"10",_oneway:"true"}},{qu:{_desired:"qwa",_distance:"10",_oneway:"true"}},{qu:{_desired:"qwc",_distance:"10",_oneway:"true"}},{qu:{_desired:"qwh",_distance:"10",_oneway:"true"}},{qu:{_desired:"qws",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxa",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxc",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxh",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxl",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxn",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxo",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxp",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxr",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxt",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxu",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxw",_distance:"10",_oneway:"true"}},{sc:{_desired:"sdc",_distance:"10",_oneway:"true"}},{sc:{_desired:"sdn",_distance:"10",_oneway:"true"}},{sc:{_desired:"sro",_distance:"10",_oneway:"true"}},{sq:{_desired:"aae",_distance:"10",_oneway:"true"}},{sq:{_desired:"aat",_distance:"10",_oneway:"true"}},{sq:{_desired:"aln",_distance:"10",_oneway:"true"}},{syr:{_desired:"aii",_distance:"10",_oneway:"true"}},{uz:{_desired:"uzs",_distance:"10",_oneway:"true"}},{yi:{_desired:"yih",_distance:"10",_oneway:"true"}},{zh:{_desired:"cdo",_distance:"10",_oneway:"true"}},{zh:{_desired:"cjy",_distance:"10",_oneway:"true"}},{zh:{_desired:"cpx",_distance:"10",_oneway:"true"}},{zh:{_desired:"czh",_distance:"10",_oneway:"true"}},{zh:{_desired:"czo",_distance:"10",_oneway:"true"}},{zh:{_desired:"gan",_distance:"10",_oneway:"true"}},{zh:{_desired:"hak",_distance:"10",_oneway:"true"}},{zh:{_desired:"hsn",_distance:"10",_oneway:"true"}},{zh:{_desired:"lzh",_distance:"10",_oneway:"true"}},{zh:{_desired:"mnp",_distance:"10",_oneway:"true"}},{zh:{_desired:"nan",_distance:"10",_oneway:"true"}},{zh:{_desired:"wuu",_distance:"10",_oneway:"true"}},{zh:{_desired:"yue",_distance:"10",_oneway:"true"}},{"*":{_desired:"*",_distance:"80"}},{"en-Latn":{_desired:"am-Ethi",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"az-Latn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"bn-Beng",_distance:"10",_oneway:"true"}},{"zh-Hans":{_desired:"bo-Tibt",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"hy-Armn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ka-Geor",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"km-Khmr",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"kn-Knda",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"lo-Laoo",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ml-Mlym",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"my-Mymr",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ne-Deva",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"or-Orya",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"pa-Guru",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ps-Arab",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"sd-Arab",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"si-Sinh",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ta-Taml",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"te-Telu",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ti-Ethi",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"tk-Latn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ur-Arab",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"uz-Latn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"yi-Hebr",_distance:"10",_oneway:"true"}},{"sr-Cyrl":{_desired:"sr-Latn",_distance:"5"}},{"zh-Hans":{_desired:"za-Latn",_distance:"10",_oneway:"true"}},{"zh-Hans":{_desired:"zh-Hani",_distance:"20",_oneway:"true"}},{"zh-Hant":{_desired:"zh-Hani",_distance:"20",_oneway:"true"}},{"ar-Arab":{_desired:"ar-Latn",_distance:"20",_oneway:"true"}},{"bn-Beng":{_desired:"bn-Latn",_distance:"20",_oneway:"true"}},{"gu-Gujr":{_desired:"gu-Latn",_distance:"20",_oneway:"true"}},{"hi-Deva":{_desired:"hi-Latn",_distance:"20",_oneway:"true"}},{"kn-Knda":{_desired:"kn-Latn",_distance:"20",_oneway:"true"}},{"ml-Mlym":{_desired:"ml-Latn",_distance:"20",_oneway:"true"}},{"mr-Deva":{_desired:"mr-Latn",_distance:"20",_oneway:"true"}},{"ta-Taml":{_desired:"ta-Latn",_distance:"20",_oneway:"true"}},{"te-Telu":{_desired:"te-Latn",_distance:"20",_oneway:"true"}},{"zh-Hans":{_desired:"zh-Latn",_distance:"20",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Latn",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Hani",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Hira",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Kana",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Hrkt",_distance:"5",_oneway:"true"}},{"ja-Hrkt":{_desired:"ja-Hira",_distance:"5",_oneway:"true"}},{"ja-Hrkt":{_desired:"ja-Kana",_distance:"5",_oneway:"true"}},{"ko-Kore":{_desired:"ko-Hani",_distance:"5",_oneway:"true"}},{"ko-Kore":{_desired:"ko-Hang",_distance:"5",_oneway:"true"}},{"ko-Kore":{_desired:"ko-Jamo",_distance:"5",_oneway:"true"}},{"ko-Hang":{_desired:"ko-Jamo",_distance:"5",_oneway:"true"}},{"*-*":{_desired:"*-*",_distance:"50"}},{"ar-*-$maghreb":{_desired:"ar-*-$maghreb",_distance:"4"}},{"ar-*-$!maghreb":{_desired:"ar-*-$!maghreb",_distance:"4"}},{"ar-*-*":{_desired:"ar-*-*",_distance:"5"}},{"en-*-$enUS":{_desired:"en-*-$enUS",_distance:"4"}},{"en-*-GB":{_desired:"en-*-$!enUS",_distance:"3"}},{"en-*-$!enUS":{_desired:"en-*-$!enUS",_distance:"4"}},{"en-*-*":{_desired:"en-*-*",_distance:"5"}},{"es-*-$americas":{_desired:"es-*-$americas",_distance:"4"}},{"es-*-$!americas":{_desired:"es-*-$!americas",_distance:"4"}},{"es-*-*":{_desired:"es-*-*",_distance:"5"}},{"pt-*-$americas":{_desired:"pt-*-$americas",_distance:"4"}},{"pt-*-$!americas":{_desired:"pt-*-$!americas",_distance:"4"}},{"pt-*-*":{_desired:"pt-*-*",_distance:"5"}},{"zh-Hant-$cnsar":{_desired:"zh-Hant-$cnsar",_distance:"4"}},{"zh-Hant-$!cnsar":{_desired:"zh-Hant-$!cnsar",_distance:"4"}},{"zh-Hant-*":{_desired:"zh-Hant-*",_distance:"5"}},{"*-*-*":{_desired:"*-*-*",_distance:"4"}}]}}},Ce={"001":["001","001-status-grouping","002","005","009","011","013","014","015","017","018","019","021","029","030","034","035","039","053","054","057","061","142","143","145","150","151","154","155","AC","AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CP","CQ","CR","CU","CV","CW","CX","CY","CZ","DE","DG","DJ","DK","DM","DO","DZ","EA","EC","EE","EG","EH","ER","ES","ET","EU","EZ","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","IC","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","QO","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TA","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","UN","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],"002":["002","002-status-grouping","011","014","015","017","018","202","AO","BF","BI","BJ","BW","CD","CF","CG","CI","CM","CV","DJ","DZ","EA","EG","EH","ER","ET","GA","GH","GM","GN","GQ","GW","IC","IO","KE","KM","LR","LS","LY","MA","MG","ML","MR","MU","MW","MZ","NA","NE","NG","RE","RW","SC","SD","SH","SL","SN","SO","SS","ST","SZ","TD","TF","TG","TN","TZ","UG","YT","ZA","ZM","ZW"],"003":["003","013","021","029","AG","AI","AW","BB","BL","BM","BQ","BS","BZ","CA","CR","CU","CW","DM","DO","GD","GL","GP","GT","HN","HT","JM","KN","KY","LC","MF","MQ","MS","MX","NI","PA","PM","PR","SV","SX","TC","TT","US","VC","VG","VI"],"005":["005","AR","BO","BR","BV","CL","CO","EC","FK","GF","GS","GY","PE","PY","SR","UY","VE"],"009":["009","053","054","057","061","AC","AQ","AS","AU","CC","CK","CP","CX","DG","FJ","FM","GU","HM","KI","MH","MP","NC","NF","NR","NU","NZ","PF","PG","PN","PW","QO","SB","TA","TK","TO","TV","UM","VU","WF","WS"],"011":["011","BF","BJ","CI","CV","GH","GM","GN","GW","LR","ML","MR","NE","NG","SH","SL","SN","TG"],"013":["013","BZ","CR","GT","HN","MX","NI","PA","SV"],"014":["014","BI","DJ","ER","ET","IO","KE","KM","MG","MU","MW","MZ","RE","RW","SC","SO","SS","TF","TZ","UG","YT","ZM","ZW"],"015":["015","DZ","EA","EG","EH","IC","LY","MA","SD","TN"],"017":["017","AO","CD","CF","CG","CM","GA","GQ","ST","TD"],"018":["018","BW","LS","NA","SZ","ZA"],"019":["003","005","013","019","019-status-grouping","021","029","419","AG","AI","AR","AW","BB","BL","BM","BO","BQ","BR","BS","BV","BZ","CA","CL","CO","CR","CU","CW","DM","DO","EC","FK","GD","GF","GL","GP","GS","GT","GY","HN","HT","JM","KN","KY","LC","MF","MQ","MS","MX","NI","PA","PE","PM","PR","PY","SR","SV","SX","TC","TT","US","UY","VC","VE","VG","VI"],"021":["021","BM","CA","GL","PM","US"],"029":["029","AG","AI","AW","BB","BL","BQ","BS","CU","CW","DM","DO","GD","GP","HT","JM","KN","KY","LC","MF","MQ","MS","PR","SX","TC","TT","VC","VG","VI"],"030":["030","CN","HK","JP","KP","KR","MN","MO","TW"],"034":["034","AF","BD","BT","IN","IR","LK","MV","NP","PK"],"035":["035","BN","ID","KH","LA","MM","MY","PH","SG","TH","TL","VN"],"039":["039","AD","AL","BA","ES","GI","GR","HR","IT","ME","MK","MT","PT","RS","SI","SM","VA","XK"],"053":["053","AU","CC","CX","HM","NF","NZ"],"054":["054","FJ","NC","PG","SB","VU"],"057":["057","FM","GU","KI","MH","MP","NR","PW","UM"],"061":["061","AS","CK","NU","PF","PN","TK","TO","TV","WF","WS"],142:["030","034","035","142","143","145","AE","AF","AM","AZ","BD","BH","BN","BT","CN","CY","GE","HK","ID","IL","IN","IQ","IR","JO","JP","KG","KH","KP","KR","KW","KZ","LA","LB","LK","MM","MN","MO","MV","MY","NP","OM","PH","PK","PS","QA","SA","SG","SY","TH","TJ","TL","TM","TR","TW","UZ","VN","YE"],143:["143","KG","KZ","TJ","TM","UZ"],145:["145","AE","AM","AZ","BH","CY","GE","IL","IQ","JO","KW","LB","OM","PS","QA","SA","SY","TR","YE"],150:["039","150","151","154","155","AD","AL","AT","AX","BA","BE","BG","BY","CH","CQ","CZ","DE","DK","EE","ES","FI","FO","FR","GB","GG","GI","GR","HR","HU","IE","IM","IS","IT","JE","LI","LT","LU","LV","MC","MD","ME","MK","MT","NL","NO","PL","PT","RO","RS","RU","SE","SI","SJ","SK","SM","UA","VA","XK"],151:["151","BG","BY","CZ","HU","MD","PL","RO","RU","SK","UA"],154:["154","AX","CQ","DK","EE","FI","FO","GB","GG","IE","IM","IS","JE","LT","LV","NO","SE","SJ"],155:["155","AT","BE","CH","DE","FR","LI","LU","MC","NL"],202:["011","014","017","018","202","AO","BF","BI","BJ","BW","CD","CF","CG","CI","CM","CV","DJ","ER","ET","GA","GH","GM","GN","GQ","GW","IO","KE","KM","LR","LS","MG","ML","MR","MU","MW","MZ","NA","NE","NG","RE","RW","SC","SH","SL","SN","SO","SS","ST","SZ","TD","TF","TG","TZ","UG","YT","ZA","ZM","ZW"],419:["005","013","029","419","AG","AI","AR","AW","BB","BL","BO","BQ","BR","BS","BV","BZ","CL","CO","CR","CU","CW","DM","DO","EC","FK","GD","GF","GP","GS","GT","GY","HN","HT","JM","KN","KY","LC","MF","MQ","MS","MX","NI","PA","PE","PR","PY","SR","SV","SX","TC","TT","UY","VC","VE","VG","VI"],EU:["AT","BE","BG","CY","CZ","DE","DK","EE","ES","EU","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],EZ:["AT","BE","CY","DE","EE","ES","EZ","FI","FR","GR","IE","IT","LT","LU","LV","MT","NL","PT","SI","SK"],QO:["AC","AQ","CP","DG","QO","TA"],UN:["AD","AE","AF","AG","AL","AM","AO","AR","AT","AU","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BN","BO","BR","BS","BT","BW","BY","BZ","CA","CD","CF","CG","CH","CI","CL","CM","CN","CO","CR","CU","CV","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","ER","ES","ET","FI","FJ","FM","FR","GA","GB","GD","GE","GH","GM","GN","GQ","GR","GT","GW","GY","HN","HR","HT","HU","ID","IE","IL","IN","IQ","IR","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MG","MH","MK","ML","MM","MN","MR","MT","MU","MV","MW","MX","MY","MZ","NA","NE","NG","NI","NL","NO","NP","NR","NZ","OM","PA","PE","PG","PH","PK","PL","PT","PW","PY","QA","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SI","SK","SL","SM","SN","SO","SR","SS","ST","SV","SY","SZ","TD","TG","TH","TJ","TL","TM","TN","TO","TR","TT","TV","TZ","UA","UG","UN","US","UY","UZ","VC","VE","VN","VU","WS","YE","ZA","ZM","ZW"]},Ie=/-u(?:-[0-9a-z]{2,8})+/gi;function ke(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)}var Ae,Ne=838;function De(e,t,n){var r=t.split("-"),i=r[0],s=r[1],o=r[2],a=!0;if(o&&"$"===o[0]){var u="!"!==o[1],l=(u?n[o.slice(1)]:n[o.slice(2)]).map((function(e){return Ce[e]||[e]})).reduce((function(e,t){return(0,Se.__spreadArray)((0,Se.__spreadArray)([],e,!0),t,!0)}),[]);a&&(a=!(l.indexOf(e.region||"")>1!=u))}else a&&(a=!e.region||("*"===o||o===e.region));return a&&(a=!e.script||("*"===s||s===e.script)),a&&(a=!e.language||("*"===i||i===e.language)),a}function Pe(e){return[e.language,e.script,e.region].filter(Boolean).join("-")}function xe(e,t,n){for(var r=0,i=n.matches;r<i.length;r++){var s=i[r],o=De(e,s.desired,n.matchVariables)&&De(t,s.supported,n.matchVariables);if(s.oneway||o||(o=De(e,s.supported,n.matchVariables)&&De(t,s.desired,n.matchVariables)),o){var a=10*s.distance;return n.paradigmLocales.indexOf(Pe(e))>-1!=n.paradigmLocales.indexOf(Pe(t))>-1?a-1:a}}throw new Error("No matching distance found")}function Re(e,t){var n=new Intl.Locale(e).maximize(),r=new Intl.Locale(t).maximize(),i={language:n.language,script:n.script||"",region:n.region||""},s={language:r.language,script:r.script||"",region:r.region||""},o=0,a=function(){var e,t;if(!Ae){var n=null===(t=null===(e=Te.supplemental.languageMatching["written-new"][0])||void 0===e?void 0:e.paradigmLocales)||void 0===t?void 0:t._locales.split(" "),r=Te.supplemental.languageMatching["written-new"].slice(1,5),i=Te.supplemental.languageMatching["written-new"].slice(5).map((function(e){var t=Object.keys(e)[0],n=e[t];return{supported:t,desired:n._desired,distance:+n._distance,oneway:"true"===n.oneway}}),{});Ae={matches:i,matchVariables:r.reduce((function(e,t){var n=Object.keys(t)[0],r=t[n];return e[n.slice(1)]=r._value.split("+"),e}),{}),paradigmLocales:(0,Se.__spreadArray)((0,Se.__spreadArray)([],n,!0),n.map((function(e){return new Intl.Locale(e.replace(/_/g,"-")).maximize().toString()})),!0)}}return Ae}();return i.language!==s.language&&(o+=xe({language:n.language,script:"",region:""},{language:r.language,script:"",region:""},a)),i.script!==s.script&&(o+=xe({language:n.language,script:i.script,region:""},{language:r.language,script:i.script,region:""},a)),i.region!==s.region&&(o+=xe(i,s,a)),o}function Oe(e,t,n){var r,i,s=[],o=t.reduce((function(e,t){var n=t.replace(Ie,"");return s.push(n),e[n]=t,e}),{}),a=function(e,t,n){void 0===n&&(n=Ne);var r=1/0,i={matchedDesiredLocale:"",distances:{}};return e.forEach((function(e,n){i.distances[e]||(i.distances[e]={}),t.forEach((function(t){var s=Re(e,t)+0+40*n;i.distances[e][t]=s,s<r&&(r=s,i.matchedDesiredLocale=e,i.matchedSupportedLocale=t)}))})),r>=n&&(i.matchedDesiredLocale=void 0,i.matchedSupportedLocale=void 0),i}(s,e);return a.matchedSupportedLocale&&a.matchedDesiredLocale&&(r=a.matchedSupportedLocale,i=o[a.matchedDesiredLocale].slice(a.matchedDesiredLocale.length)||void 0),r?{locale:r,extension:i}:{locale:n()}}function Le(e,t){for(var n=t;;){if(e.indexOf(n)>-1)return n;var r=n.lastIndexOf("-");if(!~r)return;r>=2&&"-"===n[r-2]&&(r-=2),n=n.slice(0,r)}}function Me(e,t){ke(2===t.length,"key must have 2 elements");var n=e.length,r="-".concat(t,"-"),i=e.indexOf(r);if(-1!==i){for(var s=i+4,o=s,a=s,u=!1;!u;){var l=e.indexOf("-",a);2===(-1===l?n-a:l-a)?u=!0:-1===l?(o=n,u=!0):(o=l,a=l+1)}return e.slice(s,o)}if(r="-".concat(t),-1!==(i=e.indexOf(r))&&i+3===n)return""}function Fe(e,t,n,r,i,s){var o;o="lookup"===n.localeMatcher?function(e,t,n){for(var r={locale:""},i=0,s=t;i<s.length;i++){var o=s[i],a=o.replace(Ie,""),u=Le(e,a);if(u)return r.locale=u,o!==a&&(r.extension=o.slice(a.length,o.length)),r}return r.locale=n(),r}(Array.from(e),t,s):Oe(Array.from(e),t,s);for(var a=o.locale,u={locale:"",dataLocale:a},l="-u",c=0,h=r;c<h.length;c++){var d=h[c];ke(a in i,"Missing locale data for ".concat(a));var f=i[a];ke("object"==typeof f&&null!==f,"locale data ".concat(d," must be an object"));var p=f[d];ke(Array.isArray(p),"keyLocaleData for ".concat(d," must be an array"));var m=p[0];ke("string"==typeof m||null===m,"value must be string or null but got ".concat(typeof m," in key ").concat(d));var g="";if(o.extension){var y=Me(o.extension,d);void 0!==y&&(""!==y?~p.indexOf(y)&&(m=y,g="-".concat(d,"-").concat(m)):~y.indexOf("true")&&(m="true",g="-".concat(d)))}if(d in n){var _=n[d];ke("string"==typeof _||null==_,"optionsValue must be String, Undefined or Null"),~p.indexOf(_)&&_!==m&&(m=_,g="")}u[d]=m,l+=g}if(l.length>2){var v=a.indexOf("-x-");if(-1===v)a+=l;else{var b=a.slice(0,v),w=a.slice(v,a.length);a=b+l+w}a=Intl.getCanonicalLocales(a)[0]}return u.locale=a,u}function je(e,t){for(var n=[],r=0,i=t;r<i.length;r++){var s=Le(e,i[r].replace(Ie,""));s&&n.push(s)}return n}function Ue(e,t,n,r,i){var s=j(t,"minimumIntegerDigits",1,21,1),o=t.minimumFractionDigits,a=t.maximumFractionDigits,u=t.minimumSignificantDigits,l=t.maximumSignificantDigits;e.minimumIntegerDigits=s;var c=U(t,"roundingPriority","string",["auto","morePrecision","lessPrecision"],"auto"),h=void 0!==u||void 0!==l,d=void 0!==o||void 0!==a,f=!0,p=!0;if("auto"===c&&(f=h,(h||!d&&"compact"===i)&&(p=!1)),f&&(h?(u=F(u,1,21,1),l=F(l,u,21,21),e.minimumSignificantDigits=u,e.maximumSignificantDigits=l):(e.minimumSignificantDigits=1,e.maximumSignificantDigits=21)),p)if(d){if(o=F(o,0,20,void 0),a=F(a,0,20,void 0),void 0===o)o=Math.min(n,a);else if(void 0===a)a=Math.max(r,o);else if(o>a)throw new RangeError("Invalid range, ".concat(o," > ").concat(a));e.minimumFractionDigits=o,e.maximumFractionDigits=a}else e.minimumFractionDigits=n,e.maximumFractionDigits=r;f||p?e.roundingType="morePrecision"===c?"morePrecision":"lessPrecision"===c?"lessPrecision":h?"significantDigits":"fractionDigits":(e.roundingType="morePrecision",e.minimumFractionDigits=0,e.maximumFractionDigits=0,e.minimumSignificantDigits=1,e.maximumSignificantDigits=2)}function Be(e,t,n){void 0===t&&(t=Object.create(null));var r=(0,n.getInternalSlots)(e),i=U(t,"style","string",["decimal","percent","currency","unit"],"decimal");r.style=i;var s=U(t,"currency","string",void 0,void 0);if(void 0!==s&&!W(s))throw RangeError("Malformed currency code");if("currency"===i&&void 0===s)throw TypeError("currency cannot be undefined");var o=U(t,"currencyDisplay","string",["code","symbol","narrowSymbol","name"],"symbol"),a=U(t,"currencySign","string",["standard","accounting"],"standard"),u=U(t,"unit","string",void 0,void 0);if(void 0!==u&&!Q(u))throw RangeError("Invalid unit argument for Intl.NumberFormat()");if("unit"===i&&void 0===u)throw TypeError("unit cannot be undefined");var l=U(t,"unitDisplay","string",["short","narrow","long"],"short");"currency"===i&&(r.currency=s.toUpperCase(),r.currencyDisplay=o,r.currencySign=a),"unit"===i&&(r.unit=u,r.unitDisplay=l)}var Ve=[1,2,5,10,20,25,50,100,200,250,500,1e3,2e3];function He(e,t,n,i){var s=i.getInternalSlots,o=i.localeData,a=i.availableLocales,u=i.numberingSystemNames,l=i.getDefaultLocale,c=i.currencyDigitsData,h=r(t),d=M(n),f=Object.create(null),p=U(d,"localeMatcher","string",["lookup","best fit"],"best fit");f.localeMatcher=p;var m=U(d,"numberingSystem","string",void 0,void 0);if(void 0!==m&&u.indexOf(m)<0)throw RangeError("Invalid numberingSystems: ".concat(m));f.nu=m;var g=Fe(Array.from(a),h,f,["nu"],o,l),y=o[g.dataLocale];(0,J.V1)(!!y,"Missing locale data for ".concat(g.dataLocale));var _=s(e);_.locale=g.locale,_.dataLocale=g.dataLocale,_.numberingSystem=g.nu,_.dataLocaleData=y,Be(e,d,{getInternalSlots:s});var v,b,w=_.style;if("currency"===w){var E=ie(_.currency,{currencyDigitsData:c});v=E,b=E}else v=0,b="percent"===w?0:3;var S=U(d,"notation","string",["standard","scientific","engineering","compact"],"standard");_.notation=S,Ue(_,d,v,b,S);var T=j(d,"roundingIncrement",1,5e3,1);if(-1===Ve.indexOf(T))throw new RangeError("Invalid rounding increment value: ".concat(T,".\nValid values are ").concat(Ve,"."));if(1!==T&&"fractionDigits"!==_.roundingType)throw new TypeError("For roundingIncrement > 1 only fractionDigits is a valid roundingType");if(1!==T&&_.maximumFractionDigits!==_.minimumFractionDigits)throw new RangeError("With roundingIncrement > 1, maximumFractionDigits and minimumFractionDigits must be equal.");_.roundingIncrement=T;var C=U(d,"trailingZeroDisplay","string",["auto","stripIfInteger"],"auto");_.trailingZeroDisplay=C;var I=U(d,"compactDisplay","string",["short","long"],"short"),k="auto";return"compact"===S&&(_.compactDisplay=I,k="min2"),_.useGrouping=V(d,"useGrouping",["min2","auto","always"],"always",!1,k),_.signDisplay=U(d,"signDisplay","string",["auto","never","always","exceptZero","negative"],"auto"),_.roundingMode=U(d,"roundingMode","string",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],"halfExpand"),e}function ze(e){for(var t=[],n=e.indexOf("{"),r=0,i=0,s=e.length;n<e.length&&n>-1;)r=e.indexOf("}",n),(0,J.V1)(r>n,"Invalid pattern ".concat(e)),n>i&&t.push({type:"literal",value:e.substring(i,n)}),t.push({type:e.substring(n+1,r),value:void 0}),i=r+1,n=e.indexOf("{",i);return i<s&&t.push({type:"literal",value:e.substring(i,s)}),t}function qe(e,t,n){return void 0!==n&&U(n=u(n),"localeMatcher","string",["lookup","best fit"],"best fit"),je(Array.from(e),t)}var Ge;!function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="MISSING_LOCALE_DATA",t}(0,Se.__extends)(t,e)}(Error);function $e(e){return"MISSING_LOCALE_DATA"===e.type}!function(e){e.startRange="startRange",e.shared="shared",e.endRange="endRange"}(Ge||(Ge={}))},"./node_modules/@formatjs/ecma402-abstract/lib/utils.js":function(e,t,n){"use strict";function r(e){return Math.floor(Math.log(e)*Math.LOG10E)}function i(e,t){if("function"==typeof e.repeat)return e.repeat(t);for(var n=new Array(t),r=0;r<n.length;r++)n[r]=e;return n.join("")}function s(e,t,n,r){e.get(t)||e.set(t,Object.create(null)),e.get(t)[n]=r}function o(e,t,n){for(var r=0,i=Object.keys(n);r<i.length;r++){var o=i[r];s(e,t,o,n[o])}}function a(e,t,n){return u(e,t,n)[n]}function u(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e.get(t);if(!i)throw new TypeError("".concat(t," InternalSlot has not been initialized"));return n.reduce((function(e,t){return e[t]=i[t],e}),Object.create(null))}function l(e){return"literal"===e.type}function c(e,t,n){var r=n.value;Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:r})}n.d(t,{Cp:function(){return u},Kp:function(){return a},V1:function(){return h},Vp:function(){return r},_T:function(){return s},n8:function(){return c},pM:function(){return l},ux:function(){return i},yB:function(){return o}});function h(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)}},"./node_modules/@formatjs/fast-memoize/lib/index.js":function(e,t,n){"use strict";function r(e,t){var n=t&&t.cache?t.cache:c,r=t&&t.serializer?t.serializer:u;return(t&&t.strategy?t.strategy:a)(e,{cache:n,serializer:r})}function i(e,t,n,r){var i,s=null==(i=r)||"number"==typeof i||"boolean"==typeof i?r:n(r),o=t.get(s);return void 0===o&&(o=e.call(this,r),t.set(s,o)),o}function s(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),s=t.get(i);return void 0===s&&(s=e.apply(this,r),t.set(i,s)),s}function o(e,t,n,r,i){return n.bind(t,e,r,i)}function a(e,t){return o(e,this,1===e.length?i:s,t.cache.create(),t.serializer)}n.d(t,{B:function(){return r},W:function(){return h}});var u=function(){return JSON.stringify(arguments)};function l(){this.cache=Object.create(null)}l.prototype.get=function(e){return this.cache[e]},l.prototype.set=function(e,t){this.cache[e]=t};var c={create:function(){return new l}},h={variadic:function(e,t){return o(e,this,s,t.cache.create(),t.serializer)},monadic:function(e,t){return o(e,this,i,t.cache.create(),t.serializer)}}},"./node_modules/@formatjs/icu-messageformat-parser/lib/index.js":function(e,t,n){"use strict";n.d(t,{ZE:function(){return i},Im:function(){return u},tv:function(){return c},Tu:function(){return y},eW:function(){return a},oF:function(){return l},N1:function(){return g},N6:function(){return f},jA:function(){return p},Jp:function(){return d},xm:function(){return m},Qh:function(){return h},qg:function(){return se}});var r,i,s,o=n("./node_modules/tslib/tslib.es6.mjs");function a(e){return e.type===i.literal}function u(e){return e.type===i.argument}function l(e){return e.type===i.number}function c(e){return e.type===i.date}function h(e){return e.type===i.time}function d(e){return e.type===i.select}function f(e){return e.type===i.plural}function p(e){return e.type===i.pound}function m(e){return e.type===i.tag}function g(e){return!(!e||"object"!=typeof e||e.type!==s.number)}function y(e){return!(!e||"object"!=typeof e||e.type!==s.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(r||(r={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(i||(i={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(s||(s={}));var _=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,v=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function b(e){var t={};return e.replace(v,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"long":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var w=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var E=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,S=/^(@+)?(\+|#+)?[rs]?$/g,T=/(\*)(0+)|(#+)(0+)|(0+)/g,C=/^(0+)$/;function I(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(S,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function k(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function A(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!C.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function N(e){var t=k(e);return t||{}}function D(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=i.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},t),{notation:"scientific"}),i.options.reduce((function(e,t){return(0,o.__assign)((0,o.__assign)({},e),N(t))}),{}));continue;case"engineering":t=(0,o.__assign)((0,o.__assign)((0,o.__assign)({},t),{notation:"engineering"}),i.options.reduce((function(e,t){return(0,o.__assign)((0,o.__assign)({},e),N(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(T,(function(e,n,r,i,s,o){if(n)t.minimumIntegerDigits=r.length;else{if(i&&s)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(C.test(i.stem))t.minimumIntegerDigits=i.stem.length;else if(E.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(E,(function(e,n,r,i,s,o){return"*"===r?t.minimumFractionDigits=n.length:i&&"#"===i[0]?t.maximumFractionDigits=i.length:s&&o?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+o.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var s=i.options[0];"w"===s?t=(0,o.__assign)((0,o.__assign)({},t),{trailingZeroDisplay:"stripIfInteger"}):s&&(t=(0,o.__assign)((0,o.__assign)({},t),I(s)))}else if(S.test(i.stem))t=(0,o.__assign)((0,o.__assign)({},t),I(i.stem));else{var a=k(i.stem);a&&(t=(0,o.__assign)((0,o.__assign)({},t),a));var u=A(i.stem);u&&(t=(0,o.__assign)((0,o.__assign)({},t),u))}}return t}var P,x={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function R(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(x[n||""]||x[r||""]||x["".concat(r,"-001")]||x["001"])[0]}var O=new RegExp("^".concat(_.source,"*")),L=new RegExp("".concat(_.source,"*$"));function M(e,t){return{start:e,end:t}}var F=!!String.prototype.startsWith&&"_a".startsWith("a",1),j=!!String.fromCodePoint,U=!!Object.fromEntries,B=!!String.prototype.codePointAt,V=!!String.prototype.trimStart,H=!!String.prototype.trimEnd,z=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},q=!0;try{q="a"===(null===(P=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===P?void 0:P[0])}catch(e){q=!1}var G,$=F?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},K=j?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",i=e.length,s=0;i>s;){if((n=e[s++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},W=U?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n],s=i[0],o=i[1];t[s]=o}return t},Q=B?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,i=e.charCodeAt(t);return i<55296||i>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?i:r-56320+(i-55296<<10)+65536}},Y=V?function(e){return e.trimStart()}:function(e){return e.replace(O,"")},X=H?function(e){return e.trimEnd()}:function(e){return e.replace(L,"")};function J(e,t){return new RegExp(e,t)}if(q){var Z=J("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");G=function(e,t){var n;return Z.lastIndex=t,null!==(n=Z.exec(e)[1])&&void 0!==n?n:""}}else G=function(e,t){for(var n=[];;){var r=Q(e,t);if(void 0===r||ne(r)||re(r))break;n.push(r),t+=r>=65536?2:1}return K.apply(void 0,n)};var ee=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var s=[];!this.isEOF();){var o=this.char();if(123===o){if((a=this.parseArgument(e,n)).err)return a;s.push(a.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(r.UNMATCHED_CLOSING_TAG,M(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&te(this.peek()||0)){if((a=this.parseTag(e,t)).err)return a;s.push(a.val)}else{var a;if((a=this.parseLiteral(e,t)).err)return a;s.push(a.val)}}else{var u=this.clonePosition();this.bump(),s.push({type:i.pound,location:M(u,this.clonePosition())})}}}return{val:s,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var s=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:i.literal,value:"<".concat(s,"/>"),location:M(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var a=o.val,u=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!te(this.char()))return this.error(r.INVALID_TAG,M(u,this.clonePosition()));var l=this.clonePosition();return s!==this.parseTagName()?this.error(r.UNMATCHED_CLOSING_TAG,M(l,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:i.tag,value:s,children:a,location:M(n,this.clonePosition())},err:null}:this.error(r.INVALID_TAG,M(u,this.clonePosition())))}return this.error(r.UNCLOSED_TAG,M(n,this.clonePosition()))}return this.error(r.INVALID_TAG,M(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var s=this.tryParseQuote(t);if(s)r+=s;else{var o=this.tryParseUnquoted(e,t);if(o)r+=o;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var u=M(n,this.clonePosition());return{val:{type:i.literal,value:r,location:u},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(te(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return K.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),K(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,M(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(r.EMPTY_ARGUMENT,M(n,this.clonePosition()));var s=this.parseIdentifierIfPossible().value;if(!s)return this.error(r.MALFORMED_ARGUMENT,M(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,M(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:i.argument,value:s,location:M(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,M(n,this.clonePosition())):this.parseArgumentOptions(e,t,s,n);default:return this.error(r.MALFORMED_ARGUMENT,M(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=G(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:M(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,a){var u,l=this.clonePosition(),c=this.parseIdentifierIfPossible().value,h=this.clonePosition();switch(c){case"":return this.error(r.EXPECT_ARGUMENT_TYPE,M(l,h));case"number":case"date":case"time":this.bumpSpace();var d=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition();if((E=this.parseSimpleArgStyleIfPossible()).err)return E;if(0===(y=X(E.val)).length)return this.error(r.EXPECT_ARGUMENT_STYLE,M(this.clonePosition(),this.clonePosition()));d={style:y,styleLocation:M(f,this.clonePosition())}}if((S=this.tryParseArgumentClose(a)).err)return S;var p=M(a,this.clonePosition());if(d&&$(null==d?void 0:d.style,"::",0)){var m=Y(d.style.slice(2));if("number"===c)return(E=this.parseNumberSkeletonFromString(m,d.styleLocation)).err?E:{val:{type:i.number,value:n,location:p,style:E.val},err:null};if(0===m.length)return this.error(r.EXPECT_DATE_TIME_SKELETON,p);var g=m;this.locale&&(g=function(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if("j"===i){for(var s=0;r+1<e.length&&e.charAt(r+1)===i;)s++,r++;var o=1+(1&s),a=s<2?1:3+(s>>1),u=R(t);for("H"!=u&&"k"!=u||(a=0);a-- >0;)n+="a";for(;o-- >0;)n=u+n}else n+="J"===i?"H":i}return n}(m,this.locale));var y={type:s.dateTime,pattern:g,location:d.styleLocation,parsedOptions:this.shouldParseSkeletons?b(g):{}};return{val:{type:"date"===c?i.date:i.time,value:n,location:p,style:y},err:null}}return{val:{type:"number"===c?i.number:"date"===c?i.date:i.time,value:n,location:p,style:null!==(u=null==d?void 0:d.style)&&void 0!==u?u:null},err:null};case"plural":case"selectordinal":case"select":var _=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(r.EXPECT_SELECT_ARGUMENT_OPTIONS,M(_,(0,o.__assign)({},_)));this.bumpSpace();var v=this.parseIdentifierIfPossible(),w=0;if("select"!==c&&"offset"===v.value){if(!this.bumpIf(":"))return this.error(r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,M(this.clonePosition(),this.clonePosition()));var E;if(this.bumpSpace(),(E=this.tryParseDecimalInteger(r.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,r.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return E;this.bumpSpace(),v=this.parseIdentifierIfPossible(),w=E.val}var S,T=this.tryParsePluralOrSelectOptions(e,c,t,v);if(T.err)return T;if((S=this.tryParseArgumentClose(a)).err)return S;var C=M(a,this.clonePosition());return"select"===c?{val:{type:i.select,value:n,options:W(T.val),location:C},err:null}:{val:{type:i.plural,value:n,options:W(T.val),offset:w,pluralType:"plural"===c?"cardinal":"ordinal",location:C},err:null};default:return this.error(r.INVALID_ARGUMENT_TYPE,M(l,h))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(r.EXPECT_ARGUMENT_CLOSING_BRACE,M(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(r.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,M(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(w).filter((function(e){return e.length>0}));n<r.length;n++){var i=r[n].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var s=i[0],o=i.slice(1),a=0,u=o;a<u.length;a++)if(0===u[a].length)throw new Error("Invalid number skeleton");t.push({stem:s,options:o})}return t}(e)}catch(e){return this.error(r.INVALID_NUMBER_SKELETON,t)}return{val:{type:s.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?D(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,i){for(var s,o=!1,a=[],u=new Set,l=i.value,c=i.location;;){if(0===l.length){var h=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(r.EXPECT_PLURAL_ARGUMENT_SELECTOR,r.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=M(h,this.clonePosition()),l=this.message.slice(h.offset,this.offset())}if(u.has(l))return this.error("select"===t?r.DUPLICATE_SELECT_ARGUMENT_SELECTOR:r.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(o=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?r.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:r.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,M(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,n);if(p.err)return p;var m=this.tryParseArgumentClose(f);if(m.err)return m;a.push([l,{value:p.val,location:M(f,this.clonePosition())}]),u.add(l),this.bumpSpace(),l=(s=this.parseIdentifierIfPossible()).value,c=s.location}return 0===a.length?this.error("select"===t?r.EXPECT_SELECT_ARGUMENT_SELECTOR:r.EXPECT_PLURAL_ARGUMENT_SELECTOR,M(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(r.MISSING_OTHER_CLAUSE,M(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var i=!1,s=0;!this.isEOF();){var o=this.char();if(!(o>=48&&o<=57))break;i=!0,s=10*s+(o-48),this.bump()}var a=M(r,this.clonePosition());return i?z(s*=n)?{val:s,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Q(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if($(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ne(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function te(e){return e>=97&&e<=122||e>=65&&e<=90}function ne(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function re(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function ie(e){e.forEach((function(e){if(delete e.location,d(e)||f(e))for(var t in e.options)delete e.options[t].location,ie(e.options[t].value);else l(e)&&g(e.style)||(c(e)||h(e))&&y(e.style)?delete e.style.location:m(e)&&ie(e.children)}))}function se(e,t){void 0===t&&(t={}),t=(0,o.__assign)({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ee(e,t).parse();if(n.err){var i=SyntaxError(r[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return(null==t?void 0:t.captureLocation)||ie(n.val),n.val}},"./node_modules/@formatjs/intl/lib/index.js":function(e,t,n){"use strict";n.r(t),n.d(t,{DEFAULT_INTL_CONFIG:function(){return r.JF},IntlError:function(){return i.Ar},IntlErrorCode:function(){return i.lo},IntlFormatError:function(){return i.pg},InvalidConfigError:function(){return i.uo},MessageFormatError:function(){return i.Ho},MissingDataError:function(){return i.hr},MissingTranslationError:function(){return i.sb},UnsupportedFormatterError:function(){return i.OC},createFormatters:function(){return r.GT},createIntl:function(){return d.E},createIntlCache:function(){return r.MT},defineMessage:function(){return p},defineMessages:function(){return f},filterProps:function(){return r.J9},formatDate:function(){return o.Yq},formatDateToParts:function(){return o.RZ},formatDisplayName:function(){return a.d},formatList:function(){return u.k},formatMessage:function(){return s.h},formatNumber:function(){return h.ZV},formatNumberToParts:function(){return h.QL},formatPlural:function(){return l.y},formatRelativeTime:function(){return c.f},formatTime:function(){return o.fU},formatTimeToParts:function(){return o.Ki},getNamedFormat:function(){return r.F3}});var r=n("./node_modules/@formatjs/intl/lib/src/utils.js"),i=n("./node_modules/@formatjs/intl/lib/src/error.js"),s=n("./node_modules/@formatjs/intl/lib/src/message.js"),o=n("./node_modules/@formatjs/intl/lib/src/dateTime.js"),a=n("./node_modules/@formatjs/intl/lib/src/displayName.js"),u=n("./node_modules/@formatjs/intl/lib/src/list.js"),l=n("./node_modules/@formatjs/intl/lib/src/plural.js"),c=n("./node_modules/@formatjs/intl/lib/src/relativeTime.js"),h=n("./node_modules/@formatjs/intl/lib/src/number.js"),d=n("./node_modules/@formatjs/intl/lib/src/create-intl.js");function f(e){return e}function p(e){return e}},"./node_modules/@formatjs/intl/lib/src/create-intl.js":function(e,t,n){"use strict";n.d(t,{E:function(){return p}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/@formatjs/intl/lib/src/utils.js"),s=n("./node_modules/@formatjs/intl/lib/src/error.js"),o=n("./node_modules/@formatjs/intl/lib/src/number.js"),a=n("./node_modules/@formatjs/intl/lib/src/relativeTime.js"),u=n("./node_modules/@formatjs/intl/lib/src/dateTime.js"),l=n("./node_modules/@formatjs/intl/lib/src/plural.js"),c=n("./node_modules/@formatjs/intl/lib/src/message.js"),h=n("./node_modules/@formatjs/intl/lib/src/list.js"),d=n("./node_modules/@formatjs/intl/lib/src/displayName.js");function f(e){var t;e.onWarn&&e.defaultRichTextElements&&"string"==typeof((t=e.messages||{})?t[Object.keys(t)[0]]:void 0)&&e.onWarn('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution')}function p(e,t){var n=(0,i.GT)(t),p=(0,r.__assign)((0,r.__assign)({},i.JF),e),m=p.locale,g=p.defaultLocale,y=p.onError;return m?!Intl.NumberFormat.supportedLocalesOf(m).length&&y?y(new s.hr('Missing locale data for locale: "'.concat(m,'" in Intl.NumberFormat. Using default locale: "').concat(g,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(m).length&&y&&y(new s.hr('Missing locale data for locale: "'.concat(m,'" in Intl.DateTimeFormat. Using default locale: "').concat(g,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(y&&y(new s.uo('"locale" was not configured, using "'.concat(g,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),p.locale=p.defaultLocale||"en"),f(p),(0,r.__assign)((0,r.__assign)({},p),{formatters:n,formatNumber:o.ZV.bind(null,p,n.getNumberFormat),formatNumberToParts:o.QL.bind(null,p,n.getNumberFormat),formatRelativeTime:a.f.bind(null,p,n.getRelativeTimeFormat),formatDate:u.Yq.bind(null,p,n.getDateTimeFormat),formatDateToParts:u.RZ.bind(null,p,n.getDateTimeFormat),formatTime:u.fU.bind(null,p,n.getDateTimeFormat),formatDateTimeRange:u.mi.bind(null,p,n.getDateTimeFormat),formatTimeToParts:u.Ki.bind(null,p,n.getDateTimeFormat),formatPlural:l.y.bind(null,p,n.getPluralRules),formatMessage:c.h.bind(null,p,n),$t:c.h.bind(null,p,n),formatList:h.k.bind(null,p,n.getListFormat),formatListToParts:h.d.bind(null,p,n.getListFormat),formatDisplayName:d.d.bind(null,p,n.getDisplayNames)})}},"./node_modules/@formatjs/intl/lib/src/dateTime.js":function(e,t,n){"use strict";n.d(t,{Ki:function(){return d},RZ:function(){return h},Yq:function(){return u},fU:function(){return l},mi:function(){return c}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/@formatjs/intl/lib/src/utils.js"),s=n("./node_modules/@formatjs/intl/lib/src/error.js"),o=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function a(e,t,n,s){var a=e.locale,u=e.formats,l=e.onError,c=e.timeZone;void 0===s&&(s={});var h=s.format,d=(0,r.__assign)((0,r.__assign)({},c&&{timeZone:c}),h&&(0,i.F3)(u,t,h,l)),f=(0,i.J9)(s,o,d);return"time"!==t||f.hour||f.minute||f.second||f.timeStyle||f.dateStyle||(f=(0,r.__assign)((0,r.__assign)({},f),{hour:"numeric",minute:"numeric"})),n(a,f)}function u(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],o=n[1],u=void 0===o?{}:o,l="string"==typeof i?new Date(i||0):i;try{return a(e,"date",t,u).format(l)}catch(t){e.onError(new s.pg("Error formatting date.",e.locale,t))}return String(l)}function l(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],o=n[1],u=void 0===o?{}:o,l="string"==typeof i?new Date(i||0):i;try{return a(e,"time",t,u).format(l)}catch(t){e.onError(new s.pg("Error formatting time.",e.locale,t))}return String(l)}function c(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var a=n[0],u=n[1],l=n[2],c=void 0===l?{}:l,h=e.timeZone,d=e.locale,f=e.onError,p=(0,i.J9)(c,o,h?{timeZone:h}:{});try{return t(d,p).formatRange(a,u)}catch(t){f(new s.pg("Error formatting date time range.",e.locale,t))}return String(a)}function h(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],o=n[1],u=void 0===o?{}:o,l="string"==typeof i?new Date(i||0):i;try{return a(e,"date",t,u).formatToParts(l)}catch(t){e.onError(new s.pg("Error formatting date.",e.locale,t))}return[]}function d(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],o=n[1],u=void 0===o?{}:o,l="string"==typeof i?new Date(i||0):i;try{return a(e,"time",t,u).formatToParts(l)}catch(t){e.onError(new s.pg("Error formatting time.",e.locale,t))}return[]}},"./node_modules/@formatjs/intl/lib/src/displayName.js":function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var r=n("./node_modules/@formatjs/intl/lib/src/utils.js"),i=n("./node_modules/intl-messageformat/lib/src/error.js"),s=n("./node_modules/@formatjs/intl/lib/src/error.js"),o=["style","type","fallback","languageDisplay"];function a(e,t,n,a){var u=e.locale,l=e.onError;Intl.DisplayNames||l(new i.IF('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n',i.O4.MISSING_INTL_API));var c=(0,r.J9)(a,o);try{return t(u,c).of(n)}catch(e){l(new s.pg("Error formatting display name.",u,e))}}},"./node_modules/@formatjs/intl/lib/src/error.js":function(e,t,n){"use strict";n.d(t,{Ar:function(){return s},Ho:function(){return c},OC:function(){return o},hr:function(){return u},lo:function(){return r},pg:function(){return l},sb:function(){return h},uo:function(){return a}});var r,i=n("./node_modules/tslib/tslib.es6.mjs");!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"}(r||(r={}));var s=function(e){function t(n,r,i){var s=this,o=i?i instanceof Error?i:new Error(String(i)):void 0;return(s=e.call(this,"[@formatjs/intl Error ".concat(n,"] ").concat(r,"\n").concat(o?"\n".concat(o.message,"\n").concat(o.stack):""))||this).code=n,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s,t),s}return(0,i.__extends)(t,e),t}(Error),o=function(e){function t(t,n){return e.call(this,r.UNSUPPORTED_FORMATTER,t,n)||this}return(0,i.__extends)(t,e),t}(s),a=function(e){function t(t,n){return e.call(this,r.INVALID_CONFIG,t,n)||this}return(0,i.__extends)(t,e),t}(s),u=function(e){function t(t,n){return e.call(this,r.MISSING_DATA,t,n)||this}return(0,i.__extends)(t,e),t}(s),l=function(e){function t(t,n,i){var s=e.call(this,r.FORMAT_ERROR,"".concat(t,"\nLocale: ").concat(n,"\n"),i)||this;return s.locale=n,s}return(0,i.__extends)(t,e),t}(s),c=function(e){function t(t,n,r,i){var s=e.call(this,"".concat(t,"\nMessageID: ").concat(null==r?void 0:r.id,"\nDefault Message: ").concat(null==r?void 0:r.defaultMessage,"\nDescription: ").concat(null==r?void 0:r.description,"\n"),n,i)||this;return s.descriptor=r,s.locale=n,s}return(0,i.__extends)(t,e),t}(l),h=function(e){function t(t,n){var i=e.call(this,r.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(n,'", using ').concat(t.defaultMessage?"default message (".concat("string"==typeof t.defaultMessage?t.defaultMessage:t.defaultMessage.map((function(e){var t;return null!==(t=e.value)&&void 0!==t?t:JSON.stringify(e)})).join(),")"):"id"," as fallback."))||this;return i.descriptor=t,i}return(0,i.__extends)(t,e),t}(s)},"./node_modules/@formatjs/intl/lib/src/list.js":function(e,t,n){"use strict";n.d(t,{d:function(){return c},k:function(){return l}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/@formatjs/intl/lib/src/utils.js"),s=n("./node_modules/intl-messageformat/lib/src/error.js"),o=n("./node_modules/@formatjs/intl/lib/src/error.js"),a=["type","style"],u=Date.now();function l(e,t,n,r){void 0===r&&(r={});var i=c(e,t,n,r).reduce((function(e,t){var n=t.value;return"string"!=typeof n?e.push(n):"string"==typeof e[e.length-1]?e[e.length-1]+=n:e.push(n),e}),[]);return 1===i.length?i[0]:0===i.length?"":i}function c(e,t,n,l){var c=e.locale,h=e.onError;void 0===l&&(l={}),Intl.ListFormat||h(new s.IF('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n',s.O4.MISSING_INTL_API));var d=(0,i.J9)(l,a);try{var f={},p=n.map((function(e,t){if("object"==typeof e){var n=function(e){return"".concat(u,"_").concat(e,"_").concat(u)}(t);return f[n]=e,n}return String(e)}));return t(c,d).formatToParts(p).map((function(e){return"literal"===e.type?e:(0,r.__assign)((0,r.__assign)({},e),{value:f[e.value]||e.value})}))}catch(e){h(new o.pg("Error formatting list.",c,e))}return n}},"./node_modules/@formatjs/intl/lib/src/message.js":function(e,t,n){"use strict";n.d(t,{h:function(){return h}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/@formatjs/ecma402-abstract/lib/utils.js"),s=n("./node_modules/intl-messageformat/lib/src/core.js"),o=n("./node_modules/@formatjs/intl/lib/src/error.js"),a=n("./node_modules/@formatjs/icu-messageformat-parser/lib/index.js");function u(e,t){return Object.keys(e).reduce((function(n,i){return n[i]=(0,r.__assign)({timeZone:t},e[i]),n}),{})}function l(e,t){return Object.keys((0,r.__assign)((0,r.__assign)({},e),t)).reduce((function(n,i){return n[i]=(0,r.__assign)((0,r.__assign)({},e[i]||{}),t[i]||{}),n}),{})}function c(e,t){if(!t)return e;var n=s.S.formats;return(0,r.__assign)((0,r.__assign)((0,r.__assign)({},n),e),{date:l(u(n.date,t),u(e.date||{},t)),time:l(u(n.time,t),u(e.time||{},t))})}var h=function(e,t,n,s,u){var l=e.locale,h=e.formats,d=e.messages,f=e.defaultLocale,p=e.defaultFormats,m=e.fallbackOnEmptyString,g=e.onError,y=e.timeZone,_=e.defaultRichTextElements;void 0===n&&(n={id:""});var v=n.id,b=n.defaultMessage;(0,i.V1)(!!v,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var w=String(v),E=d&&Object.prototype.hasOwnProperty.call(d,w)&&d[w];if(Array.isArray(E)&&1===E.length&&E[0].type===a.ZE.literal)return E[0].value;if(!s&&E&&"string"==typeof E&&!_)return E.replace(/'\{(.*?)\}'/gi,"{$1}");if(s=(0,r.__assign)((0,r.__assign)({},_),s||{}),h=c(h,y),p=c(p,y),!E){if(!1===m&&""===E)return E;if((!b||l&&l.toLowerCase()!==f.toLowerCase())&&g(new o.sb(n,l)),b)try{return t.getMessageFormat(b,f,p,u).format(s)}catch(e){return g(new o.Ho('Error formatting default message for: "'.concat(w,'", rendering default message verbatim'),l,n,e)),"string"==typeof b?b:w}return w}try{return t.getMessageFormat(E,l,h,(0,r.__assign)({formatters:t},u||{})).format(s)}catch(e){g(new o.Ho('Error formatting message: "'.concat(w,'", using ').concat(b?"default message":"id"," as fallback."),l,n,e))}if(b)try{return t.getMessageFormat(b,f,p,u).format(s)}catch(e){g(new o.Ho('Error formatting the default message for: "'.concat(w,'", rendering message verbatim'),l,n,e))}return"string"==typeof E?E:"string"==typeof b?b:w}},"./node_modules/@formatjs/intl/lib/src/number.js":function(e,t,n){"use strict";n.d(t,{QL:function(){return u},ZV:function(){return a}});var r=n("./node_modules/@formatjs/intl/lib/src/error.js"),i=n("./node_modules/@formatjs/intl/lib/src/utils.js"),s=["style","currency","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem","trailingZeroDisplay","roundingPriority","roundingIncrement","roundingMode"];function o(e,t,n){var r=e.locale,o=e.formats,a=e.onError;void 0===n&&(n={});var u=n.format,l=u&&(0,i.F3)(o,"number",u,a)||{};return t(r,(0,i.J9)(n,s,l))}function a(e,t,n,i){void 0===i&&(i={});try{return o(e,t,i).format(n)}catch(t){e.onError(new r.pg("Error formatting number.",e.locale,t))}return String(n)}function u(e,t,n,i){void 0===i&&(i={});try{return o(e,t,i).formatToParts(n)}catch(t){e.onError(new r.pg("Error formatting number.",e.locale,t))}return[]}},"./node_modules/@formatjs/intl/lib/src/plural.js":function(e,t,n){"use strict";n.d(t,{y:function(){return a}});var r=n("./node_modules/@formatjs/intl/lib/src/utils.js"),i=n("./node_modules/@formatjs/intl/lib/src/error.js"),s=n("./node_modules/intl-messageformat/lib/src/error.js"),o=["type"];function a(e,t,n,a){var u=e.locale,l=e.onError;void 0===a&&(a={}),Intl.PluralRules||l(new s.IF('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',s.O4.MISSING_INTL_API));var c=(0,r.J9)(a,o);try{return t(u,c).select(n)}catch(e){l(new i.pg("Error formatting plural.",u,e))}return"other"}},"./node_modules/@formatjs/intl/lib/src/relativeTime.js":function(e,t,n){"use strict";n.d(t,{f:function(){return a}});var r=n("./node_modules/@formatjs/intl/lib/src/utils.js"),i=n("./node_modules/intl-messageformat/lib/src/error.js"),s=n("./node_modules/@formatjs/intl/lib/src/error.js"),o=["numeric","style"];function a(e,t,n,a,u){void 0===u&&(u={}),a||(a="second"),Intl.RelativeTimeFormat||e.onError(new i.IF('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',i.O4.MISSING_INTL_API));try{return function(e,t,n){var i=e.locale,s=e.formats,a=e.onError;void 0===n&&(n={});var u=n.format,l=!!u&&(0,r.F3)(s,"relative",u,a)||{};return t(i,(0,r.J9)(n,o,l))}(e,t,u).format(n,a)}catch(t){e.onError(new s.pg("Error formatting relative time.",e.locale,t))}return String(n)}},"./node_modules/@formatjs/intl/lib/src/utils.js":function(e,t,n){"use strict";n.d(t,{F3:function(){return d},GT:function(){return h},J9:function(){return a},JF:function(){return u},MT:function(){return l}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/intl-messageformat/lib/src/core.js"),s=n("./node_modules/@formatjs/fast-memoize/lib/index.js"),o=n("./node_modules/@formatjs/intl/lib/src/error.js");function a(e,t,n){return void 0===n&&(n={}),t.reduce((function(t,r){return r in e?t[r]=e[r]:r in n&&(t[r]=n[r]),t}),{})}var u={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(e){0},onWarn:function(e){0}};function l(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function c(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function h(e){void 0===e&&(e={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var t=Intl.RelativeTimeFormat,n=Intl.ListFormat,o=Intl.DisplayNames,a=(0,s.B)((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,(0,r.__spreadArray)([void 0],t,!1)))}),{cache:c(e.dateTime),strategy:s.W.variadic}),u=(0,s.B)((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,(0,r.__spreadArray)([void 0],t,!1)))}),{cache:c(e.number),strategy:s.W.variadic}),l=(0,s.B)((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,(0,r.__spreadArray)([void 0],t,!1)))}),{cache:c(e.pluralRules),strategy:s.W.variadic});return{getDateTimeFormat:a,getNumberFormat:u,getMessageFormat:(0,s.B)((function(e,t,n,s){return new i.S(e,t,n,(0,r.__assign)({formatters:{getNumberFormat:u,getDateTimeFormat:a,getPluralRules:l}},s||{}))}),{cache:c(e.message),strategy:s.W.variadic}),getRelativeTimeFormat:(0,s.B)((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new(t.bind.apply(t,(0,r.__spreadArray)([void 0],e,!1)))}),{cache:c(e.relativeTime),strategy:s.W.variadic}),getPluralRules:l,getListFormat:(0,s.B)((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(n.bind.apply(n,(0,r.__spreadArray)([void 0],e,!1)))}),{cache:c(e.list),strategy:s.W.variadic}),getDisplayNames:(0,s.B)((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(o.bind.apply(o,(0,r.__spreadArray)([void 0],e,!1)))}),{cache:c(e.displayNames),strategy:s.W.variadic})}}function d(e,t,n,r){var i,s=e&&e[t];if(s&&(i=s[n]),i)return i;r(new o.OC("No ".concat(t," format named: ").concat(n)))}},"./node_modules/@remix-run/router/dist/router.js":function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var i;n.d(t,{AO:function(){return h},Gh:function(){return O},HS:function(){return L},Oi:function(){return a},Rr:function(){return d},TM:function(){return o},pX:function(){return B},pb:function(){return D},rc:function(){return i},tH:function(){return U},tW:function(){return k},ue:function(){return m},yD:function(){return R}}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(i||(i={}));const s="popstate";function o(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:n="/",search:r="",hash:i=""}=d(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),c("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:h(t))}),(function(e,t){u("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function a(e,t){if(!1===e||null==e)throw new Error(t)}function u(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function l(e,t){return{usr:e.state,key:e.key,idx:t}}function c(e,t,n,i){return void 0===n&&(n=null),r({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?d(t):t,{state:n,key:t&&t.key||i||Math.random().toString(36).substr(2,8)})}function h(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function d(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function f(e,t,n,o){void 0===o&&(o={});let{window:u=document.defaultView,v5Compat:d=!1}=o,f=u.history,p=i.Pop,m=null,g=y();function y(){return(f.state||{idx:null}).idx}function _(){p=i.Pop;let e=y(),t=null==e?null:e-g;g=e,m&&m({action:p,location:b.location,delta:t})}function v(e){let t="null"!==u.location.origin?u.location.origin:u.location.href,n="string"==typeof e?e:h(e);return n=n.replace(/ $/,"%20"),a(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,f.replaceState(r({},f.state,{idx:g}),""));let b={get action(){return p},get location(){return e(u,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return u.addEventListener(s,_),m=e,()=>{u.removeEventListener(s,_),m=null}},createHref(e){return t(u,e)},createURL:v,encodeLocation(e){let t=v(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=i.Push;let r=c(b.location,e,t);n&&n(r,e),g=y()+1;let s=l(r,g),o=b.createHref(r);try{f.pushState(s,"",o)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;u.location.assign(o)}d&&m&&m({action:p,location:b.location,delta:1})},replace:function(e,t){p=i.Replace;let r=c(b.location,e,t);n&&n(r,e),g=y();let s=l(r,g),o=b.createHref(r);f.replaceState(s,"",o),d&&m&&m({action:p,location:b.location,delta:0})},go(e){return f.go(e)}};return b}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function m(e,t,n){void 0===n&&(n="/");let r=D(("string"==typeof t?d(t):t).pathname||"/",n);if(null==r)return null;let i=g(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let s=null;for(let e=0;null==s&&e<i.length;++e){let t=N(r);s=I(i[e],t)}return s}function g(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let i=(e,i,s)=>{let o={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(a(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let u=L([r,o.relativePath]),l=n.concat(o);e.children&&e.children.length>0&&(a(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+u+'".'),g(e.children,t,l,u)),(null!=e.path||e.index)&&t.push({path:u,score:C(u,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of y(e.path))i(e,t,n);else i(e,t)})),t}function y(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(0===r.length)return i?[s,""]:[s];let o=y(r.join("/")),a=[];return a.push(...o.map((e=>""===e?s:[s,e].join("/")))),i&&a.push(...o),a.map((t=>e.startsWith("/")&&""===t?"/":t))}const _=/^:[\w-]+$/,v=3,b=2,w=1,E=10,S=-2,T=e=>"*"===e;function C(e,t){let n=e.split("/"),r=n.length;return n.some(T)&&(r+=S),t&&(r+=b),n.filter((e=>!T(e))).reduce(((e,t)=>e+(_.test(t)?v:""===t?w:E)),r)}function I(e,t){let{routesMeta:n}=e,r={},i="/",s=[];for(let e=0;e<n.length;++e){let o=n[e],a=e===n.length-1,u="/"===i?t:t.slice(i.length)||"/",l=A({path:o.relativePath,caseSensitive:o.caseSensitive,end:a},u);if(!l)return null;Object.assign(r,l.params);let c=o.route;s.push({params:r,pathname:L([i,l.pathname]),pathnameBase:M(L([i,l.pathnameBase])),route:c}),"/"!==l.pathnameBase&&(i=L([i,l.pathnameBase]))}return s}function k(e,t){void 0===t&&(t={});let n=e;n.endsWith("*")&&"*"!==n&&!n.endsWith("/*")&&(u(!1,'Route path "'+n+'" will be treated as if it were "'+n.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+n.replace(/\*$/,"/*")+'".'),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",i=e=>null==e?"":"string"==typeof e?e:String(e);return r+n.split(/\/+/).map(((e,n,r)=>{if(n===r.length-1&&"*"===e){return i(t["*"])}const s=e.match(/^:([\w-]+)(\??)$/);if(s){const[,e,n]=s;let r=t[e];return a("?"===n||null!=r,'Missing ":'+e+'" param'),i(r)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function A(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);u("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))");let s=new RegExp(i,t?void 0:"i");return[s,r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:i}=t;if("*"===r){let e=a[n]||"";o=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}const u=a[n];return e[r]=i&&!u?void 0:(u||"").replace(/%2F/g,"/"),e}),{}),pathname:s,pathnameBase:o,pattern:e}}function N(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return u(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function D(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function P(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function x(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function R(e,t){let n=x(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function O(e,t,n,i){let s;void 0===i&&(i=!1),"string"==typeof e?s=d(e):(s=r({},e),a(!s.pathname||!s.pathname.includes("?"),P("?","pathname","search",s)),a(!s.pathname||!s.pathname.includes("#"),P("#","pathname","hash",s)),a(!s.search||!s.search.includes("#"),P("#","search","hash",s)));let o,u=""===e||""===s.pathname,l=u?"/":s.pathname;if(null==l)o=n;else{let e=t.length-1;if(!i&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;s.pathname=t.join("/")}o=e>=0?t[e]:"/"}let c=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?d(e):e,s=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:s,search:F(r),hash:j(i)}}(s,o),h=l&&"/"!==l&&l.endsWith("/"),f=(u||"."===l)&&n.endsWith("/");return c.pathname.endsWith("/")||!h&&!f||(c.pathname+="/"),c}const L=e=>e.join("/").replace(/\/\/+/g,"/"),M=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),F=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",j=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class U extends Error{}function B(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const V=["post","put","patch","delete"],H=(new Set(V),["get",...V]);new Set(H),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred")},"./node_modules/baron/src/autoUpdate.js":function(e){"use strict";function t(e){var t,n=this;if(!this._au){var r=n._debounce((function(){n.update()}),300);this._observer=new e((function(){i(),n.update(),r()})),this.on("init",(function(){n._observer.observe(n.root,{childList:!0,subtree:!0,characterData:!0}),i()})),this.on("dispose",(function(){n._observer.disconnect(),s(),delete n._observer})),this._au=!0}function i(){n.root[n.origin.offset]?s():function(){if(t)return;t=setInterval((function(){n.root[n.origin.offset]&&(s(),n.update())}),300)}()}function s(){clearInterval(t),t=null}}e.exports=function(e){var n=e.MutationObserver||e.WebKitMutationObserver||e.MozMutationObserver||null;return function(){return n?(t.call(this,n),this):this}}},"./node_modules/baron/src/controls.js":function(e,t,n){"use strict";var r=n("./node_modules/baron/src/utils.js").qs;e.exports=function(e){var t,n,i,s=this;n=e.screen||.9,e.forward&&(i={element:r(e.forward,this.clipper),handler:function(){var t=s.pos()+(e.delta||30);s.pos(t)},type:"click"},this._eventHandlers.push(i),this.event(i.element,i.type,i.handler,"on")),e.backward&&(i={element:r(e.backward,this.clipper),handler:function(){var t=s.pos()-(e.delta||30);s.pos(t)},type:"click"},this._eventHandlers.push(i),this.event(i.element,i.type,i.handler,"on")),e.track&&(t=!0===e.track?this.track:r(e.track,this.clipper))&&(i={element:t,handler:function(e){if(e.target==t){var r=e["offset"+s.origin.x],i=s.bar[s.origin.offsetPos],o=0;r<i?o=-1:r>i+s.bar[s.origin.offset]&&(o=1);var a=s.pos()+o*n*s.scroller[s.origin.client];s.pos(a)}},type:"mousedown"},this._eventHandlers.push(i),this.event(i.element,i.type,i.handler,"on"))}},"./node_modules/baron/src/core.js":function(e,t,n){"use strict";var r=function(){return this||(0,eval)("this")}(),i=r&&r.window||r,s=n("./node_modules/baron/src/utils.js").f0,o=n("./node_modules/baron/src/utils.js").AH,a=n("./node_modules/baron/src/utils.js").WQ,u=n("./node_modules/baron/src/utils.js").zy,l=n("./node_modules/baron/src/utils.js").rm,c=n("./node_modules/baron/src/utils.js").o8,h=n("./node_modules/baron/src/utils.js").qs,d=y,f=["left","top","right","bottom","width","height"],p=[],m={v:{x:"Y",pos:f[1],oppos:f[3],crossPos:f[0],crossOpPos:f[2],size:f[5],crossSize:f[4],crossMinSize:"min-"+f[4],crossMaxSize:"max-"+f[4],client:"clientHeight",crossClient:"clientWidth",scrollEdge:"scrollLeft",offset:"offsetHeight",crossOffset:"offsetWidth",offsetPos:"offsetTop",scroll:"scrollTop",scrollSize:"scrollHeight"},h:{x:"X",pos:f[0],oppos:f[2],crossPos:f[1],crossOpPos:f[3],size:f[4],crossSize:f[5],crossMinSize:"min-"+f[5],crossMaxSize:"max-"+f[5],client:"clientWidth",crossClient:"clientHeight",scrollEdge:"scrollTop",offset:"offsetWidth",crossOffset:"offsetHeight",offsetPos:"offsetLeft",scroll:"scrollLeft",scrollSize:"scrollWidth"}},g=/[\s\S]*Macintosh[\s\S]*\) Gecko[\s\S]*/.test(i.navigator&&i.navigator.userAgent);function y(e){var t,n,r=e&&e[0]||e,o="string"==typeof e||r instanceof HTMLElement?{root:e}:c(e),a={direction:"v",barOnCls:"_scrollbar",resizeDebounce:0,event:s,cssGuru:!1,impact:"scroller",position:"static"};for(var u in o=o||{},a)null==o[u]&&(o[u]=a[u]);t=this&&this instanceof i.jQuery,o._chain?n=o.root:t?o.root=n=this[0]:n=h(o.root||o.scroller);var l=b(n,o.direction),d=+l;if(o.index=d,d==d&&null!==l&&p[d])return p[d];o.root&&o.scroller?o.scroller=h(o.scroller,n):o.scroller=n,o.root=n;var f=function(e){var t=new y.prototype.constructor(e);v(t,e.event,"on"),b(t.root,e.direction,"on",p.length),p.push(t),!1;return t.update(),t}(o);return f.autoUpdate&&f.autoUpdate(),f}function _(){return(new Date).getTime()}function v(e,t,n){e._eventHandlers=e._eventHandlers||[{element:e.scroller,handler:function(t){e.scroll(t)},type:"scroll"},{element:e.root,handler:function(){e.update()},type:"transitionend animationend"},{element:e.scroller,handler:function(){e.update()},type:"keyup"},{element:e.bar,handler:function(t){t.preventDefault(),e.selection(),e.drag.now=1,e.draggingCls&&a(e.root,e.draggingCls)},type:"touchstart mousedown"},{element:document,handler:function(){e.selection(1),e.drag.now=0,e.draggingCls&&l(e.root,e.draggingCls)},type:"mouseup blur touchend"},{element:document,handler:function(t){2!=t.button&&e._pos0(t)},type:"touchstart mousedown"},{element:document,handler:function(t){e.drag.now&&e.drag(t)},type:"mousemove touchmove"},{element:i,handler:function(){e.update()},type:"resize"},{element:e.root,handler:function(){e.update()},type:"sizeChange"},{element:e.clipper,handler:function(){e.clipperOnScroll()},type:"scroll"}],function(e,t){var n=0,r=e;for(void 0!==r.length&&r!==i||(r=[r]);r[n];)t.call(this,r[n],n),n++}(e._eventHandlers,(function(e){if(e.element)if(e.element.length&&e.element!==i)for(var r=0;r<e.element.length;r++)t(e.element[r],e.type,e.handler,n);else t(e.element,e.type,e.handler,n)}))}function b(e,t,n,r){var i="data-baron-"+t+"-id";return"on"==n?e.setAttribute(i,r):"off"==n&&e.removeAttribute(i),e.getAttribute(i)}function w(e){if(this.events&&this.events[e])for(var t=0;t<this.events[e].length;t++){var n=Array.prototype.slice.call(arguments,1);this.events[e][t].apply(this,n)}}y.prototype={_debounce:function(e,t){var n,r,i=this,s=function(){if(i._disposed)return clearTimeout(n),void(n=i=null);var o=_()-r;o<t&&o>=0?n=setTimeout(s,t-o):(n=null,e())};return function(){r=_(),n||(n=setTimeout(s,t))}},constructor:function(e){var t,n,r,s,c,d,f;function p(e){var t=this.barMinSize||20,n=e;n>0&&n<t&&(n=t),this.bar&&o(this.bar,this.origin.size,parseInt(n,10)+"px")}function y(e){if(this.bar){var t=o(this.bar,this.origin.pos),n=+e+"px";n&&n!=t&&o(this.bar,this.origin.pos,n)}}function v(){return r[this.origin.client]-this.barTopLimit-this.bar[this.origin.offset]}function b(e){return e*v.call(this)+this.barTopLimit}function E(e){return(e-this.barTopLimit)/v.call(this)}function S(){return!1}if(d=_(),this.params=e,this.event=e.event,this.events={},this.root=e.root,this.scroller=h(e.scroller),this.bar=h(e.bar,this.root),r=this.track=h(e.track,this.root),!this.track&&this.bar&&(r=this.bar.parentNode),this.clipper=this.scroller.parentNode,this.direction=e.direction,this.rtl=e.rtl,this.origin=m[this.direction],this.barOnCls=e.barOnCls,this.scrollingCls=e.scrollingCls,this.draggingCls=e.draggingCls,this.impact=e.impact,this.position=e.position,this.rtl=e.rtl,this.barTopLimit=0,this.resizeDebounce=e.resizeDebounce,this.cursor=function(e){return e["client"+this.origin.x]||(((e.originalEvent||e).touches||{})[0]||{})["page"+this.origin.x]},this.pos=function(e){var t="page"+this.origin.x+"Offset",n=this.scroller[t]?t:this.origin.scroll;return void 0!==e&&(this.scroller[n]=e),this.scroller[n]},this.rpos=function(e){var t=this.scroller[this.origin.scrollSize]-this.scroller[this.origin.client];return(e?this.pos(e*t):this.pos())/(t||1)},this.barOn=function(e){if(this.barOnCls){var t=this.scroller[this.origin.client]>=this.scroller[this.origin.scrollSize];e||t?u(this.root,this.barOnCls)&&l(this.root,this.barOnCls):u(this.root,this.barOnCls)||a(this.root,this.barOnCls)}},this._pos0=function(e){n=this.cursor(e)-t},this.drag=function(e){var t=E.call(this,this.cursor(e)-n),r=this.scroller[this.origin.scrollSize]-this.scroller[this.origin.client];this.scroller[this.origin.scroll]=t*r},this.selection=function(e){this.event(document,"selectpos selectstart",S,e?"off":"on")},this.resize=function(){var e=this,t=void 0===e.resizeDebounce?300:e.resizeDebounce,n=0;function r(){var t,n=e.scroller[e.origin.crossOffset],r=e.scroller[e.origin.crossClient],i=0;if(g?i=15:r>0&&0===n&&(n=r+17),n)if(e.barOn(),"scroller"==e.impact){var s=n-r+i;if("static"==e.position)o(e.scroller,e.origin.crossSize)!=(t=e.clipper[e.origin.crossClient]+s+"px")&&e._setCrossSizes(e.scroller,t);else{var a={},u=e.rtl?"Left":"Right";"h"==e.direction&&(u="Bottom"),a["padding"+u]=s+"px",o(e.scroller,a)}}else o(e.clipper,e.origin.crossSize)!=(t=r+"px")&&e._setCrossSizes(e.clipper,t);Array.prototype.unshift.call(arguments,"resize"),w.apply(e,arguments),d=_()}_()-d<t&&(clearTimeout(s),n=t),n?s=setTimeout(r,n):r()},this.updatePositions=function(e){var n,i=this;i.bar&&(n=(r[i.origin.client]-i.barTopLimit)*i.scroller[i.origin.client]/i.scroller[i.origin.scrollSize],(e||parseInt(f,10)!=parseInt(n,10))&&(p.call(i,n),f=n),t=b.call(i,i.rpos()),y.call(i,t)),Array.prototype.unshift.call(arguments,"scroll"),w.apply(i,arguments)},this.scroll=function(){var e=this;e.updatePositions(),e.scrollingCls&&(c||a(e.root,e.scrollingCls),clearTimeout(c),c=setTimeout((function(){l(e.root,e.scrollingCls),c=void 0}),300))},this.clipperOnScroll=function(){this.rtl?this.clipper[this.origin.scrollEdge]=this.clipper[this.origin.scrollSize]:this.clipper[this.origin.scrollEdge]=0},this._setCrossSizes=function(e,t){var n={};n[this.origin.crossSize]=t,n[this.origin.crossMinSize]=t,n[this.origin.crossMaxSize]=t,o(e,n)},this._dumbCss=function(t){if(!e.cssGuru){var n=t?"hidden":null,r=t?"none":null;o(this.clipper,{overflow:n,msOverflowStyle:r,position:"static"==this.position?"":"relative"});var i=t?"scroll":null,s={};s["overflow-"+("v"==this.direction?"y":"x")]=i,s["box-sizing"]="border-box",s.margin="0",s.border="0","absolute"==this.position&&(s.position="absolute",s.top="0","h"==this.direction?s.left=s.right="0":(s.bottom="0",s.right=this.rtl?"0":"",s.left=this.rtl?"":"0")),o(this.scroller,s)}},this._dumbCss(!0),g){var T="paddingRight",C={},I=i.getComputedStyle(this.scroller)[[T]];"h"==e.direction?T="paddingBottom":e.rtl&&(T="paddingLeft");var k=parseInt(I,10);k!=k&&(k=0),C[T]=15+k+"px",o(this.scroller,C)}return this},update:function(e){return w.call(this,"upd",e),this.resize(1),this.updatePositions(1),this},dispose:function(){v(this,this.event,"off"),b(this.root,this.params.direction,"off"),"v"==this.params.direction?this._setCrossSizes(this.scroller,""):this._setCrossSizes(this.clipper,""),this._dumbCss(!1),this.barOn(!0),w.call(this,"dispose"),p[this.params.index]=null,this.params=null,this._disposed=!0},on:function(e,t,n){for(var r=e.split(" "),i=0;i<r.length;i++)"init"==r[i]?t.call(this,n):(this.events[r[i]]=this.events[r[i]]||[],this.events[r[i]].push((function(e){t.call(this,e||n)})))},baron:function(e){return e.root=this.params.root,e.scroller=this.params.scroller,e.direction="v"==this.params.direction?"h":"v",e._chain=!0,y(e)}},y.prototype.constructor.prototype=y.prototype,y.noConflict=function(){return i.baron=d,y},y.version="3.0.1",y.prototype.autoUpdate=n("./node_modules/baron/src/autoUpdate.js")(i),y.prototype.fix=n("./node_modules/baron/src/fix.js"),y.prototype.controls=n("./node_modules/baron/src/controls.js"),e.exports=y},"./node_modules/baron/src/fix.js":function(e,t,n){"use strict";n("./node_modules/baron/src/log.js");var r=n("./node_modules/baron/src/utils.js").AH,i=n("./node_modules/baron/src/utils.js").WQ,s=n("./node_modules/baron/src/utils.js").rm;e.exports=function(e){var t,n,o={outside:"",inside:"",before:"",after:"",past:"",future:"",radius:0,minView:0},a=[],u=[],l=[],c=this.scroller,h=this.event,d=this;function f(e,a,u){var l=a,c=1==u?"pos":"oppos";n<(o.minView||0)&&(l=void 0),r(t[e],this.origin.pos,""),r(t[e],this.origin.oppos,""),s(t[e],o.outside),void 0!==l&&(l+="px",r(t[e],this.origin[c],l),i(t[e],o.outside))}function p(e){try{var t=document.createEvent("WheelEvent");t.initWebKitWheelEvent(e.originalEvent.wheelDeltaX,e.originalEvent.wheelDeltaY),c.dispatchEvent(t),e.preventDefault()}catch(e){}}function m(e){var i;for(var s in e)o[s]=e[s];if(o.elements instanceof HTMLElement?t=[o.elements]:"string"==typeof o.elements?t=this.scroller.querySelectorAll(o.elements):o.elements&&o.elements[0]instanceof HTMLElement&&(t=o.elements),t){n=this.scroller[this.origin.client];for(var c=0;c<t.length;c++)(i={})[this.origin.size]=t[c][this.origin.offset]+"px",t[c].parentNode!==this.scroller&&r(t[c].parentNode,i),(i={})[this.origin.crossSize]=t[c].parentNode[this.origin.crossClient]+"px",r(t[c],i),n-=t[c][this.origin.offset],l[c]=t[c].parentNode[this.origin.offsetPos],a[c]=a[c-1]||0,u[c]=u[c-1]||Math.min(l[c],0),t[c-1]&&(a[c]+=t[c-1][this.origin.offset],u[c]+=t[c-1][this.origin.offset]),0==c&&0==l[c]||(this.event(t[c],"mousewheel",p,"off"),this.event(t[c],"mousewheel",p));o.limiter&&t[0]&&(this.track&&this.track!=this.scroller?((i={})[this.origin.pos]=t[0].parentNode[this.origin.offset]+"px",r(this.track,i)):this.barTopLimit=t[0].parentNode[this.origin.offset],this.scroll()),!1===o.limiter&&(this.barTopLimit=0)}var f={element:t,handler:function(){for(var e,n=this.parentNode.offsetTop,r=0;r<t.length;r++)t[r]===this&&(e=r);var i=n-a[e];o.scroll?o.scroll({x1:d.scroller.scrollTop,x2:i}):d.scroller.scrollTop=i},type:"click"};if(o.clickable){this._eventHandlers.push(f);for(var m=0;m<f.element.length;m++)h(f.element[m],f.type,f.handler,"on")}}this.on("init",m,e);var g=[],y=[];return this.on("init scroll",(function(){var e,r,c,h;if(t){var d;for(h=0;h<t.length;h++)e=0,l[h]-this.pos()<u[h]+o.radius?(e=1,r=a[h]):l[h]-this.pos()>u[h]+n-o.radius?(e=2,r=this.scroller[this.origin.client]-t[h][this.origin.offset]-a[h]-n):(e=3,r=void 0),c=!1,(l[h]-this.pos()<u[h]||l[h]-this.pos()>u[h]+n)&&(c=!0),e==g[h]&&c==y[h]||(f.call(this,h,r,e),g[h]=e,y[h]=c,d=!0);if(d)for(h=0;h<t.length;h++)1==g[h]&&o.past&&(i(t[h],o.past),s(t[h],o.future)),2==g[h]&&o.future&&(i(t[h],o.future),s(t[h],o.past)),3==g[h]&&(s(t[h],o.past),s(t[h],o.future),i(t[h],o.inside)),g[h]!=g[h+1]&&1==g[h]?(i(t[h],o.before),s(t[h],o.after)):g[h]!=g[h-1]&&2==g[h]?(i(t[h],o.after),s(t[h],o.before)):(s(t[h],o.before),s(t[h],o.after)),o.grad&&(y[h]?i(t[h],o.grad):s(t[h],o.grad))}})),this.on("resize upd",(function(e){m.call(this,e&&e.fix)})),this}},"./node_modules/baron/src/log.js":function(e){e.exports=function(e,t,n){var r=console[e]||console.log,i=["Baron: "+t,n];Function.prototype.apply.call(r,console,i)}},"./node_modules/baron/src/utils.js":function(e){"use strict";var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,n)}catch(e){}function r(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}e.exports.f0=function(e,n,r,i){var s=n.split(" "),o="on"==i?"add":"remove";s.forEach((function(n){var i=!1;-1!=["scroll","touchstart","touchmove"].indexOf(n)&&t&&(i={passive:!0}),e[o+"EventListener"](n,r,i)}))},e.exports.AH=function(e,t,n){var i;if(void 0===n){if("string"==typeof t)return e.style[t];i=t}else(i={})[t]=n;r(i,(function(t,n){e.style[t]=n}))},e.exports.WQ=function(e,t){t&&e.classList.add(t)},e.exports.rm=function(e,t){t&&e.classList.remove(t)},e.exports.zy=function(e,t){return!!t&&e.classList.contains(t)},e.exports.o8=function(e){var t={};return r(e||{},(function(e,n){t[e]=n})),t},e.exports.qs=function(e,t){return e instanceof HTMLElement?e:(t||document).querySelector(e)}},"./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js":function(e,t,n){"use strict";var r=n("./node_modules/react-is/index.js"),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function u(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var o=c(n);h&&(o=o.concat(h(n)));for(var a=u(t),m=u(n),g=0;g<o.length;++g){var y=o[g];if(!(s[y]||r&&r[y]||m&&m[y]||a&&a[y])){var _=d(n,y);try{l(t,y,_)}catch(e){}}}}return t}},"./node_modules/intl-messageformat/lib/src/core.js":function(e,t,n){"use strict";n.d(t,{S:function(){return l}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/@formatjs/icu-messageformat-parser/lib/index.js"),s=n("./node_modules/@formatjs/fast-memoize/lib/index.js"),o=n("./node_modules/intl-messageformat/lib/src/formatters.js");function a(e,t){return t?Object.keys(e).reduce((function(n,i){var s,o;return n[i]=(s=e[i],(o=t[i])?(0,r.__assign)((0,r.__assign)((0,r.__assign)({},s||{}),o||{}),Object.keys(s).reduce((function(e,t){return e[t]=(0,r.__assign)((0,r.__assign)({},s[t]),o[t]||{}),e}),{})):s),n}),(0,r.__assign)({},e)):e}function u(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}var l=function(){function e(t,n,i,l){var c,h=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=h.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===o.TT.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return(0,o.hN)(h.ast,h.locales,h.formatters,h.formats,e,void 0,h.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=h.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(h.locales)[0]}},this.getAst=function(){return h.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var d=l||{},f=(d.formatters,(0,r.__rest)(d,["formatters"]));this.ast=e.__parse(t,(0,r.__assign)((0,r.__assign)({},f),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=a(e.formats,i),this.formatters=l&&l.formatters||(void 0===(c=this.formatterCache)&&(c={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:(0,s.B)((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,(0,r.__spreadArray)([void 0],t,!1)))}),{cache:u(c.number),strategy:s.W.variadic}),getDateTimeFormat:(0,s.B)((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,(0,r.__spreadArray)([void 0],t,!1)))}),{cache:u(c.dateTime),strategy:s.W.variadic}),getPluralRules:(0,s.B)((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,(0,r.__spreadArray)([void 0],t,!1)))}),{cache:u(c.pluralRules),strategy:s.W.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=i.qg,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}()},"./node_modules/intl-messageformat/lib/src/error.js":function(e,t,n){"use strict";n.d(t,{$x:function(){return o},Ei:function(){return u},IF:function(){return s},O4:function(){return r},Zo:function(){return a}});var r,i=n("./node_modules/tslib/tslib.es6.mjs");!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(r||(r={}));var s=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.code=n,i.originalMessage=r,i}return(0,i.__extends)(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),o=function(e){function t(t,n,i,s){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(i).join('", "'),'"'),r.INVALID_VALUE,s)||this}return(0,i.__extends)(t,e),t}(s),a=function(e){function t(t,n,i){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),r.INVALID_VALUE,i)||this}return(0,i.__extends)(t,e),t}(s),u=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),r.MISSING_VALUE,n)||this}return(0,i.__extends)(t,e),t}(s)},"./node_modules/intl-messageformat/lib/src/formatters.js":function(e,t,n){"use strict";n.d(t,{RK:function(){return o},TT:function(){return r},hN:function(){return a}});var r,i=n("./node_modules/@formatjs/icu-messageformat-parser/lib/index.js"),s=n("./node_modules/intl-messageformat/lib/src/error.js");function o(e){return"function"==typeof e}function a(e,t,n,u,l,c,h){if(1===e.length&&(0,i.eW)(e[0]))return[{type:r.literal,value:e[0].value}];for(var d=[],f=0,p=e;f<p.length;f++){var m=p[f];if((0,i.eW)(m))d.push({type:r.literal,value:m.value});else if((0,i.jA)(m))"number"==typeof c&&d.push({type:r.literal,value:n.getNumberFormat(t).format(c)});else{var g=m.value;if(!l||!(g in l))throw new s.Ei(g,h);var y=l[g];if((0,i.Im)(m))y&&"string"!=typeof y&&"number"!=typeof y||(y="string"==typeof y||"number"==typeof y?String(y):""),d.push({type:"string"==typeof y?r.literal:r.object,value:y});else if((0,i.tv)(m)){var _="string"==typeof m.style?u.date[m.style]:(0,i.Tu)(m.style)?m.style.parsedOptions:void 0;d.push({type:r.literal,value:n.getDateTimeFormat(t,_).format(y)})}else if((0,i.Qh)(m)){_="string"==typeof m.style?u.time[m.style]:(0,i.Tu)(m.style)?m.style.parsedOptions:u.time.medium;d.push({type:r.literal,value:n.getDateTimeFormat(t,_).format(y)})}else if((0,i.oF)(m)){(_="string"==typeof m.style?u.number[m.style]:(0,i.N1)(m.style)?m.style.parsedOptions:void 0)&&_.scale&&(y*=_.scale||1),d.push({type:r.literal,value:n.getNumberFormat(t,_).format(y)})}else{if((0,i.xm)(m)){var v=m.children,b=m.value,w=l[b];if(!o(w))throw new s.Zo(b,"function",h);var E=w(a(v,t,n,u,l,c).map((function(e){return e.value})));Array.isArray(E)||(E=[E]),d.push.apply(d,E.map((function(e){return{type:"string"==typeof e?r.literal:r.object,value:e}})))}if((0,i.Jp)(m)){if(!(S=m.options[y]||m.options.other))throw new s.$x(m.value,y,Object.keys(m.options),h);d.push.apply(d,a(S.value,t,n,u,l))}else if((0,i.N6)(m)){var S;if(!(S=m.options["=".concat(y)])){if(!Intl.PluralRules)throw new s.IF('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',s.O4.MISSING_INTL_API,h);var T=n.getPluralRules(t,{type:m.pluralType}).select(y-(m.offset||0));S=m.options[T]||m.options.other}if(!S)throw new s.$x(m.value,y,Object.keys(m.options),h);d.push.apply(d,a(S.value,t,n,u,l,y-(m.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===r.literal&&t.type===r.literal?n.value+=t.value:e.push(t),e}),[])}(d)}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(r||(r={}))},"./node_modules/react-dom/cjs/react-dom.production.min.js":function(e,t,n){"use strict";var r=n("./node_modules/react/index.js"),i=n("./node_modules/scheduler/index.js");function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function u(e,t){l(e,t),l(e+"Capture",t)}function l(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var c=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),h=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function m(e,t,n,r,i,s,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function _(e){return e[1].toUpperCase()}function v(e,t,n,r){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!h.call(p,e)||!h.call(f,e)&&(d.test(e)?p[e]=!0:(f[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,_);g[t]=new m(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,_);g[t]=new m(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,_);g[t]=new m(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new m(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),k=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),x=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var R=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var O=Symbol.iterator;function L(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var M,F=Object.assign;function j(e){if(void 0===M)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||""}return"\n"+M+e}var U=!1;function B(e,t){if(!e||U)return"";U=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),s=r.stack.split("\n"),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==s[a]){var u="\n"+i[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=o&&0<=a);break}}}finally{U=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function V(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=B(e.type,!1);case 11:return e=B(e.type.render,!1);case 1:return e=B(e.type,!0);default:return""}}function H(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case S:return"Fragment";case E:return"Portal";case C:return"Profiler";case T:return"StrictMode";case N:return"Suspense";case D:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case k:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case A:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case P:return null!==(t=e.displayName||null)?t:H(e.type)||"Memo";case x:t=e._payload,e=e._init;try{return H(e(t))}catch(e){}}return null}function z(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(t);case 8:return t===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function q(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function G(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function $(e){e._valueTracker||(e._valueTracker=function(e){var t=G(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=G(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function W(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Q(e,t){var n=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=q(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function X(e,t){null!=(t=t.checked)&&v(e,"checked",t,!1)}function J(e,t){X(e,t);var n=q(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,q(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&W(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+q(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function re(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(s(91));return F({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(s(92));if(te(n)){if(1<n.length)throw Error(s(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:q(n)}}function se(e,t){var n=q(t.value),r=q(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var le,ce,he=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((le=le||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=le.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return ce(e,t)}))}:ce);function de(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var fe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function me(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fe.hasOwnProperty(e)&&fe[e]?(""+t).trim():t+"px"}function ge(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=me(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(fe).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fe[t]=fe[e]}))}));var ye=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _e(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(s(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(s(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(s(62))}}function ve(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var be=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ee=null,Se=null,Te=null;function Ce(e){if(e=vi(e)){if("function"!=typeof Ee)throw Error(s(280));var t=e.stateNode;t&&(t=wi(t),Ee(e.stateNode,e.type,t))}}function Ie(e){Se?Te?Te.push(e):Te=[e]:Se=e}function ke(){if(Se){var e=Se,t=Te;if(Te=Se=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function Ae(e,t){return e(t)}function Ne(){}var De=!1;function Pe(e,t,n){if(De)return e(t,n);De=!0;try{return Ae(e,t,n)}finally{De=!1,(null!==Se||null!==Te)&&(Ne(),ke())}}function xe(e,t){var n=e.stateNode;if(null===n)return null;var r=wi(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(s(231,t,typeof n));return n}var Re=!1;if(c)try{var Oe={};Object.defineProperty(Oe,"passive",{get:function(){Re=!0}}),window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch(ce){Re=!1}function Le(e,t,n,r,i,s,o,a,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Me=!1,Fe=null,je=!1,Ue=null,Be={onError:function(e){Me=!0,Fe=e}};function Ve(e,t,n,r,i,s,o,a,u){Me=!1,Fe=null,Le.apply(Be,arguments)}function He(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function ze(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function qe(e){if(He(e)!==e)throw Error(s(188))}function Ge(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=He(e)))throw Error(s(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return qe(i),e;if(o===r)return qe(i),t;o=o.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,u=i.child;u;){if(u===n){a=!0,n=i,r=o;break}if(u===r){a=!0,r=i,n=o;break}u=u.sibling}if(!a){for(u=o.child;u;){if(u===n){a=!0,n=o,r=i;break}if(u===r){a=!0,r=o,n=i;break}u=u.sibling}if(!a)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(3!==n.tag)throw Error(s(188));return n.stateNode.current===n?e:t}(e))?$e(e):null}function $e(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=$e(e);if(null!==t)return t;e=e.sibling}return null}var Ke=i.unstable_scheduleCallback,We=i.unstable_cancelCallback,Qe=i.unstable_shouldYield,Ye=i.unstable_requestPaint,Xe=i.unstable_now,Je=i.unstable_getCurrentPriorityLevel,Ze=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,nt=i.unstable_LowPriority,rt=i.unstable_IdlePriority,it=null,st=null;var ot=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(at(e)/ut|0)|0},at=Math.log,ut=Math.LN2;var lt=64,ct=4194304;function ht(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=268435455&n;if(0!==o){var a=o&~i;0!==a?r=ht(a):0!==(s&=o)&&(r=ht(s))}else 0!==(o=n&~i)?r=ht(o):0!==s&&(r=ht(s));if(0===r)return 0;if(0!==t&&t!==r&&!(t&i)&&((i=r&-r)>=(s=t&-t)||16===i&&4194240&s))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-ot(t)),r|=e[n],t&=~i;return r}function ft(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function mt(){var e=lt;return!(4194240&(lt<<=1))&&(lt=64),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ot(t)]=n}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var vt=0;function bt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var wt,Et,St,Tt,Ct,It=!1,kt=[],At=null,Nt=null,Dt=null,Pt=new Map,xt=new Map,Rt=[],Ot="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Lt(e,t){switch(e){case"focusin":case"focusout":At=null;break;case"dragenter":case"dragleave":Nt=null;break;case"mouseover":case"mouseout":Dt=null;break;case"pointerover":case"pointerout":Pt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xt.delete(t.pointerId)}}function Mt(e,t,n,r,i,s){return null===e||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},null!==t&&(null!==(t=vi(t))&&Et(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Ft(e){var t=_i(e.target);if(null!==t){var n=He(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=ze(n)))return e.blockedOn=t,void Ct(e.priority,(function(){St(n)}))}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function jt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=vi(n))&&Et(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);be=r,n.target.dispatchEvent(r),be=null,t.shift()}return!0}function Ut(e,t,n){jt(e)&&n.delete(t)}function Bt(){It=!1,null!==At&&jt(At)&&(At=null),null!==Nt&&jt(Nt)&&(Nt=null),null!==Dt&&jt(Dt)&&(Dt=null),Pt.forEach(Ut),xt.forEach(Ut)}function Vt(e,t){e.blockedOn===t&&(e.blockedOn=null,It||(It=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Bt)))}function Ht(e){function t(t){return Vt(t,e)}if(0<kt.length){Vt(kt[0],e);for(var n=1;n<kt.length;n++){var r=kt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==At&&Vt(At,e),null!==Nt&&Vt(Nt,e),null!==Dt&&Vt(Dt,e),Pt.forEach(t),xt.forEach(t),n=0;n<Rt.length;n++)(r=Rt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Rt.length&&null===(n=Rt[0]).blockedOn;)Ft(n),null===n.blockedOn&&Rt.shift()}var zt=b.ReactCurrentBatchConfig,qt=!0;function Gt(e,t,n,r){var i=vt,s=zt.transition;zt.transition=null;try{vt=1,Kt(e,t,n,r)}finally{vt=i,zt.transition=s}}function $t(e,t,n,r){var i=vt,s=zt.transition;zt.transition=null;try{vt=4,Kt(e,t,n,r)}finally{vt=i,zt.transition=s}}function Kt(e,t,n,r){if(qt){var i=Qt(e,t,n,r);if(null===i)qr(e,t,r,Wt,n),Lt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return At=Mt(At,e,t,n,r,i),!0;case"dragenter":return Nt=Mt(Nt,e,t,n,r,i),!0;case"mouseover":return Dt=Mt(Dt,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Pt.set(s,Mt(Pt.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,xt.set(s,Mt(xt.get(s)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Lt(e,r),4&t&&-1<Ot.indexOf(e)){for(;null!==i;){var s=vi(i);if(null!==s&&wt(s),null===(s=Qt(e,t,n,r))&&qr(e,t,r,Wt,n),s===i)break;i=s}null!==i&&r.stopPropagation()}else qr(e,t,r,null,n)}}var Wt=null;function Qt(e,t,n,r){if(Wt=null,null!==(e=_i(e=we(r))))if(null===(t=He(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=ze(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wt=e,null}function Yt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Je()){case Ze:return 1;case et:return 4;case tt:case nt:return 16;case rt:return 536870912;default:return 16}default:return 16}}var Xt=null,Jt=null,Zt=null;function en(){if(Zt)return Zt;var e,t,n=Jt,r=n.length,i="value"in Xt?Xt.value:Xt.textContent,s=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[s-t];t++);return Zt=i.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function rn(){return!1}function sn(e){function t(t,n,r,i,s){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?nn:rn,this.isPropagationStopped=rn,this}return F(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var on,an,un,ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cn=sn(ln),hn=F({},ln,{view:0,detail:0}),dn=sn(hn),fn=F({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(on=e.screenX-un.screenX,an=e.screenY-un.screenY):an=on=0,un=e),on)},movementY:function(e){return"movementY"in e?e.movementY:an}}),pn=sn(fn),mn=sn(F({},fn,{dataTransfer:0})),gn=sn(F({},hn,{relatedTarget:0})),yn=sn(F({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),_n=F({},ln,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vn=sn(_n),bn=sn(F({},ln,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},En={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function Cn(){return Tn}var In=F({},hn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?En[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),kn=sn(In),An=sn(F({},fn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Nn=sn(F({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),Dn=sn(F({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=F({},fn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),xn=sn(Pn),Rn=[9,13,27,32],On=c&&"CompositionEvent"in window,Ln=null;c&&"documentMode"in document&&(Ln=document.documentMode);var Mn=c&&"TextEvent"in window&&!Ln,Fn=c&&(!On||Ln&&8<Ln&&11>=Ln),jn=String.fromCharCode(32),Un=!1;function Bn(e,t){switch(e){case"keyup":return-1!==Rn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Hn=!1;var zn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!zn[e.type]:"textarea"===t}function Gn(e,t,n,r){Ie(r),0<(t=$r(t,"onChange")).length&&(n=new cn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var $n=null,Kn=null;function Wn(e){jr(e,0)}function Qn(e){if(K(bi(e)))return e}function Yn(e,t){if("change"===e)return t}var Xn=!1;if(c){var Jn;if(c){var Zn="oninput"in document;if(!Zn){var er=document.createElement("div");er.setAttribute("oninput","return;"),Zn="function"==typeof er.oninput}Jn=Zn}else Jn=!1;Xn=Jn&&(!document.documentMode||9<document.documentMode)}function tr(){$n&&($n.detachEvent("onpropertychange",nr),Kn=$n=null)}function nr(e){if("value"===e.propertyName&&Qn(Kn)){var t=[];Gn(t,Kn,e,we(e)),Pe(Wn,t)}}function rr(e,t,n){"focusin"===e?(tr(),Kn=n,($n=t).attachEvent("onpropertychange",nr)):"focusout"===e&&tr()}function ir(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Qn(Kn)}function sr(e,t){if("click"===e)return Qn(t)}function or(e,t){if("input"===e||"change"===e)return Qn(t)}var ar="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ur(e,t){if(ar(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!h.call(t,i)||!ar(e[i],t[i]))return!1}return!0}function lr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cr(e,t){var n,r=lr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=lr(r)}}function hr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?hr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function dr(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=W((e=t.contentWindow).document)}return t}function fr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pr(e){var t=dr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hr(n.ownerDocument.documentElement,n)){if(null!==r&&fr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=void 0===r.end?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=cr(n,s);var o=cr(n,r);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mr=c&&"documentMode"in document&&11>=document.documentMode,gr=null,yr=null,_r=null,vr=!1;function br(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;vr||null==gr||gr!==W(r)||("selectionStart"in(r=gr)&&fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},_r&&ur(_r,r)||(_r=r,0<(r=$r(yr,"onSelect")).length&&(t=new cn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Er={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Sr={},Tr={};function Cr(e){if(Sr[e])return Sr[e];if(!Er[e])return e;var t,n=Er[e];for(t in n)if(n.hasOwnProperty(t)&&t in Tr)return Sr[e]=n[t];return e}c&&(Tr=document.createElement("div").style,"AnimationEvent"in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),"TransitionEvent"in window||delete Er.transitionend.transition);var Ir=Cr("animationend"),kr=Cr("animationiteration"),Ar=Cr("animationstart"),Nr=Cr("transitionend"),Dr=new Map,Pr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xr(e,t){Dr.set(e,t),u(t,[e])}for(var Rr=0;Rr<Pr.length;Rr++){var Or=Pr[Rr];xr(Or.toLowerCase(),"on"+(Or[0].toUpperCase()+Or.slice(1)))}xr(Ir,"onAnimationEnd"),xr(kr,"onAnimationIteration"),xr(Ar,"onAnimationStart"),xr("dblclick","onDoubleClick"),xr("focusin","onFocus"),xr("focusout","onBlur"),xr(Nr,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Mr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Lr));function Fr(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,i,o,a,u,l){if(Ve.apply(this,arguments),Me){if(!Me)throw Error(s(198));var c=Fe;Me=!1,Fe=null,je||(je=!0,Ue=c)}}(r,t,void 0,e),e.currentTarget=null}function jr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],u=a.instance,l=a.currentTarget;if(a=a.listener,u!==s&&i.isPropagationStopped())break e;Fr(i,a,l),s=u}else for(o=0;o<r.length;o++){if(u=(a=r[o]).instance,l=a.currentTarget,a=a.listener,u!==s&&i.isPropagationStopped())break e;Fr(i,a,l),s=u}}}if(je)throw e=Ue,je=!1,Ue=null,e}function Ur(e,t){var n=t[mi];void 0===n&&(n=t[mi]=new Set);var r=e+"__bubble";n.has(r)||(zr(t,e,2,!1),n.add(r))}function Br(e,t,n){var r=0;t&&(r|=4),zr(n,e,r,t)}var Vr="_reactListening"+Math.random().toString(36).slice(2);function Hr(e){if(!e[Vr]){e[Vr]=!0,o.forEach((function(t){"selectionchange"!==t&&(Mr.has(t)||Br(t,!1,e),Br(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Vr]||(t[Vr]=!0,Br("selectionchange",!1,t))}}function zr(e,t,n,r){switch(Yt(t)){case 1:var i=Gt;break;case 4:i=$t;break;default:i=Kt}n=i.bind(null,t,n,e),i=void 0,!Re||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function qr(e,t,n,r,i){var s=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var o=r.tag;if(3===o||4===o){var a=r.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=r.return;null!==o;){var u=o.tag;if((3===u||4===u)&&((u=o.stateNode.containerInfo)===i||8===u.nodeType&&u.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=_i(a)))return;if(5===(u=o.tag)||6===u){r=s=o;continue e}a=a.parentNode}}r=r.return}Pe((function(){var r=s,i=we(n),o=[];e:{var a=Dr.get(e);if(void 0!==a){var u=cn,l=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":u=kn;break;case"focusin":l="focus",u=gn;break;case"focusout":l="blur",u=gn;break;case"beforeblur":case"afterblur":u=gn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=pn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=mn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Nn;break;case Ir:case kr:case Ar:u=yn;break;case Nr:u=Dn;break;case"scroll":u=dn;break;case"wheel":u=xn;break;case"copy":case"cut":case"paste":u=vn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=An}var c=!!(4&t),h=!c&&"scroll"===e,d=c?null!==a?a+"Capture":null:a;c=[];for(var f,p=r;null!==p;){var m=(f=p).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==d&&(null!=(m=xe(p,d))&&c.push(Gr(p,m,f)))),h)break;p=p.return}0<c.length&&(a=new u(a,l,null,n,i),o.push({event:a,listeners:c}))}}if(!(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||n===be||!(l=n.relatedTarget||n.fromElement)||!_i(l)&&!l[pi])&&(u||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,u?(u=r,null!==(l=(l=n.relatedTarget||n.toElement)?_i(l):null)&&(l!==(h=He(l))||5!==l.tag&&6!==l.tag)&&(l=null)):(u=null,l=r),u!==l)){if(c=pn,m="onMouseLeave",d="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(c=An,m="onPointerLeave",d="onPointerEnter",p="pointer"),h=null==u?a:bi(u),f=null==l?a:bi(l),(a=new c(m,p+"leave",u,n,i)).target=h,a.relatedTarget=f,m=null,_i(i)===r&&((c=new c(d,p+"enter",l,n,i)).target=f,c.relatedTarget=h,m=c),h=m,u&&l)e:{for(d=l,p=0,f=c=u;f;f=Kr(f))p++;for(f=0,m=d;m;m=Kr(m))f++;for(;0<p-f;)c=Kr(c),p--;for(;0<f-p;)d=Kr(d),f--;for(;p--;){if(c===d||null!==d&&c===d.alternate)break e;c=Kr(c),d=Kr(d)}c=null}else c=null;null!==u&&Wr(o,a,u,c,!1),null!==l&&null!==h&&Wr(o,h,l,c,!0)}if("select"===(u=(a=r?bi(r):window).nodeName&&a.nodeName.toLowerCase())||"input"===u&&"file"===a.type)var g=Yn;else if(qn(a))if(Xn)g=or;else{g=ir;var y=rr}else(u=a.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=sr);switch(g&&(g=g(e,r))?Gn(o,g,n,i):(y&&y(e,a,r),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ee(a,"number",a.value)),y=r?bi(r):window,e){case"focusin":(qn(y)||"true"===y.contentEditable)&&(gr=y,yr=r,_r=null);break;case"focusout":_r=yr=gr=null;break;case"mousedown":vr=!0;break;case"contextmenu":case"mouseup":case"dragend":vr=!1,br(o,n,i);break;case"selectionchange":if(mr)break;case"keydown":case"keyup":br(o,n,i)}var _;if(On)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else Hn?Bn(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(Fn&&"ko"!==n.locale&&(Hn||"onCompositionStart"!==v?"onCompositionEnd"===v&&Hn&&(_=en()):(Jt="value"in(Xt=i)?Xt.value:Xt.textContent,Hn=!0)),0<(y=$r(r,v)).length&&(v=new bn(v,e,null,n,i),o.push({event:v,listeners:y}),_?v.data=_:null!==(_=Vn(n))&&(v.data=_))),(_=Mn?function(e,t){switch(e){case"compositionend":return Vn(t);case"keypress":return 32!==t.which?null:(Un=!0,jn);case"textInput":return(e=t.data)===jn&&Un?null:e;default:return null}}(e,n):function(e,t){if(Hn)return"compositionend"===e||!On&&Bn(e,t)?(e=en(),Zt=Jt=Xt=null,Hn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=$r(r,"onBeforeInput")).length&&(i=new bn("onBeforeInput","beforeinput",null,n,i),o.push({event:i,listeners:r}),i.data=_))}jr(o,t)}))}function Gr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $r(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,s=i.stateNode;5===i.tag&&null!==s&&(i=s,null!=(s=xe(e,n))&&r.unshift(Gr(e,s,i)),null!=(s=xe(e,t))&&r.push(Gr(e,s,i))),e=e.return}return r}function Kr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Wr(e,t,n,r,i){for(var s=t._reactName,o=[];null!==n&&n!==r;){var a=n,u=a.alternate,l=a.stateNode;if(null!==u&&u===r)break;5===a.tag&&null!==l&&(a=l,i?null!=(u=xe(n,s))&&o.unshift(Gr(n,u,a)):i||null!=(u=xe(n,s))&&o.push(Gr(n,u,a))),n=n.return}0!==o.length&&e.push({event:t,listeners:o})}var Qr=/\r\n?/g,Yr=/\u0000|\uFFFD/g;function Xr(e){return("string"==typeof e?e:""+e).replace(Qr,"\n").replace(Yr,"")}function Jr(e,t,n){if(t=Xr(t),Xr(e)!==t&&n)throw Error(s(425))}function Zr(){}var ei=null,ti=null;function ni(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ri="function"==typeof setTimeout?setTimeout:void 0,ii="function"==typeof clearTimeout?clearTimeout:void 0,si="function"==typeof Promise?Promise:void 0,oi="function"==typeof queueMicrotask?queueMicrotask:void 0!==si?function(e){return si.resolve(null).then(e).catch(ai)}:ri;function ai(e){setTimeout((function(){throw e}))}function ui(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void Ht(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);Ht(t)}function li(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ci(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var hi=Math.random().toString(36).slice(2),di="__reactFiber$"+hi,fi="__reactProps$"+hi,pi="__reactContainer$"+hi,mi="__reactEvents$"+hi,gi="__reactListeners$"+hi,yi="__reactHandles$"+hi;function _i(e){var t=e[di];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pi]||n[di]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ci(e);null!==e;){if(n=e[di])return n;e=ci(e)}return t}n=(e=n).parentNode}return null}function vi(e){return!(e=e[di]||e[pi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function bi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(s(33))}function wi(e){return e[fi]||null}var Ei=[],Si=-1;function Ti(e){return{current:e}}function Ci(e){0>Si||(e.current=Ei[Si],Ei[Si]=null,Si--)}function Ii(e,t){Si++,Ei[Si]=e.current,e.current=t}var ki={},Ai=Ti(ki),Ni=Ti(!1),Di=ki;function Pi(e,t){var n=e.type.contextTypes;if(!n)return ki;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,s={};for(i in n)s[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function xi(e){return null!=(e=e.childContextTypes)}function Ri(){Ci(Ni),Ci(Ai)}function Oi(e,t,n){if(Ai.current!==ki)throw Error(s(168));Ii(Ai,t),Ii(Ni,n)}function Li(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(s(108,z(e)||"Unknown",i));return F({},n,r)}function Mi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ki,Di=Ai.current,Ii(Ai,e),Ii(Ni,Ni.current),!0}function Fi(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=Li(e,t,Di),r.__reactInternalMemoizedMergedChildContext=e,Ci(Ni),Ci(Ai),Ii(Ai,e)):Ci(Ni),Ii(Ni,n)}var ji=null,Ui=!1,Bi=!1;function Vi(e){null===ji?ji=[e]:ji.push(e)}function Hi(){if(!Bi&&null!==ji){Bi=!0;var e=0,t=vt;try{var n=ji;for(vt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}ji=null,Ui=!1}catch(t){throw null!==ji&&(ji=ji.slice(e+1)),Ke(Ze,Hi),t}finally{vt=t,Bi=!1}}return null}var zi=[],qi=0,Gi=null,$i=0,Ki=[],Wi=0,Qi=null,Yi=1,Xi="";function Ji(e,t){zi[qi++]=$i,zi[qi++]=Gi,Gi=e,$i=t}function Zi(e,t,n){Ki[Wi++]=Yi,Ki[Wi++]=Xi,Ki[Wi++]=Qi,Qi=e;var r=Yi;e=Xi;var i=32-ot(r)-1;r&=~(1<<i),n+=1;var s=32-ot(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Yi=1<<32-ot(t)+i|n<<i|r,Xi=s+e}else Yi=1<<s|n<<i|r,Xi=e}function es(e){null!==e.return&&(Ji(e,1),Zi(e,1,0))}function ts(e){for(;e===Gi;)Gi=zi[--qi],zi[qi]=null,$i=zi[--qi],zi[qi]=null;for(;e===Qi;)Qi=Ki[--Wi],Ki[Wi]=null,Xi=Ki[--Wi],Ki[Wi]=null,Yi=Ki[--Wi],Ki[Wi]=null}var ns=null,rs=null,is=!1,ss=null;function os(e,t){var n=Pl(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function as(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ns=e,rs=li(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ns=e,rs=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Qi?{id:Yi,overflow:Xi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Pl(18,null,null,0)).stateNode=t,n.return=e,e.child=n,ns=e,rs=null,!0);default:return!1}}function us(e){return!(!(1&e.mode)||128&e.flags)}function ls(e){if(is){var t=rs;if(t){var n=t;if(!as(e,t)){if(us(e))throw Error(s(418));t=li(n.nextSibling);var r=ns;t&&as(e,t)?os(r,n):(e.flags=-4097&e.flags|2,is=!1,ns=e)}}else{if(us(e))throw Error(s(418));e.flags=-4097&e.flags|2,is=!1,ns=e}}}function cs(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ns=e}function hs(e){if(e!==ns)return!1;if(!is)return cs(e),is=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ni(e.type,e.memoizedProps)),t&&(t=rs)){if(us(e))throw ds(),Error(s(418));for(;t;)os(e,t),t=li(t.nextSibling)}if(cs(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){rs=li(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}rs=null}}else rs=ns?li(e.stateNode.nextSibling):null;return!0}function ds(){for(var e=rs;e;)e=li(e.nextSibling)}function fs(){rs=ns=null,is=!1}function ps(e){null===ss?ss=[e]:ss.push(e)}var ms=b.ReactCurrentBatchConfig;function gs(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var i=r,o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function ys(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function _s(e){return(0,e._init)(e._payload)}function vs(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Rl(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Fl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function l(e,t,n,r){var s=n.type;return s===S?h(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===s||"object"==typeof s&&null!==s&&s.$$typeof===x&&_s(s)===t.type)?((r=i(t,n.props)).ref=gs(e,t,n),r.return=e,r):((r=Ol(n.type,n.key,n.props,null,e.mode,r)).ref=gs(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=jl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function h(e,t,n,r,s){return null===t||7!==t.tag?((t=Ll(n,e.mode,r,s)).return=e,t):((t=i(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Fl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Ol(t.type,t.key,t.props,null,e.mode,n)).ref=gs(e,null,t),n.return=e,n;case E:return(t=jl(t,e.mode,n)).return=e,t;case x:return d(e,(0,t._init)(t._payload),n)}if(te(t)||L(t))return(t=Ll(t,e.mode,n,null)).return=e,t;ys(e,t)}return null}function f(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:u(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case E:return n.key===i?c(e,t,n,r):null;case x:return f(e,t,(i=n._init)(n._payload),r)}if(te(n)||L(n))return null!==i?null:h(e,t,n,r,null);ys(e,n)}return null}function p(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return u(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case w:return l(t,e=e.get(null===r.key?n:r.key)||null,r,i);case E:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case x:return p(e,t,n,(0,r._init)(r._payload),i)}if(te(r)||L(r))return h(t,e=e.get(n)||null,r,i,null);ys(t,r)}return null}function m(i,s,a,u){for(var l=null,c=null,h=s,m=s=0,g=null;null!==h&&m<a.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var y=f(i,h,a[m],u);if(null===y){null===h&&(h=g);break}e&&h&&null===y.alternate&&t(i,h),s=o(y,s,m),null===c?l=y:c.sibling=y,c=y,h=g}if(m===a.length)return n(i,h),is&&Ji(i,m),l;if(null===h){for(;m<a.length;m++)null!==(h=d(i,a[m],u))&&(s=o(h,s,m),null===c?l=h:c.sibling=h,c=h);return is&&Ji(i,m),l}for(h=r(i,h);m<a.length;m++)null!==(g=p(h,i,m,a[m],u))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),s=o(g,s,m),null===c?l=g:c.sibling=g,c=g);return e&&h.forEach((function(e){return t(i,e)})),is&&Ji(i,m),l}function g(i,a,u,l){var c=L(u);if("function"!=typeof c)throw Error(s(150));if(null==(u=c.call(u)))throw Error(s(151));for(var h=c=null,m=a,g=a=0,y=null,_=u.next();null!==m&&!_.done;g++,_=u.next()){m.index>g?(y=m,m=null):y=m.sibling;var v=f(i,m,_.value,l);if(null===v){null===m&&(m=y);break}e&&m&&null===v.alternate&&t(i,m),a=o(v,a,g),null===h?c=v:h.sibling=v,h=v,m=y}if(_.done)return n(i,m),is&&Ji(i,g),c;if(null===m){for(;!_.done;g++,_=u.next())null!==(_=d(i,_.value,l))&&(a=o(_,a,g),null===h?c=_:h.sibling=_,h=_);return is&&Ji(i,g),c}for(m=r(i,m);!_.done;g++,_=u.next())null!==(_=p(m,i,g,_.value,l))&&(e&&null!==_.alternate&&m.delete(null===_.key?g:_.key),a=o(_,a,g),null===h?c=_:h.sibling=_,h=_);return e&&m.forEach((function(e){return t(i,e)})),is&&Ji(i,g),c}return function e(r,s,o,u){if("object"==typeof o&&null!==o&&o.type===S&&null===o.key&&(o=o.props.children),"object"==typeof o&&null!==o){switch(o.$$typeof){case w:e:{for(var l=o.key,c=s;null!==c;){if(c.key===l){if((l=o.type)===S){if(7===c.tag){n(r,c.sibling),(s=i(c,o.props.children)).return=r,r=s;break e}}else if(c.elementType===l||"object"==typeof l&&null!==l&&l.$$typeof===x&&_s(l)===c.type){n(r,c.sibling),(s=i(c,o.props)).ref=gs(r,c,o),s.return=r,r=s;break e}n(r,c);break}t(r,c),c=c.sibling}o.type===S?((s=Ll(o.props.children,r.mode,u,o.key)).return=r,r=s):((u=Ol(o.type,o.key,o.props,null,r.mode,u)).ref=gs(r,s,o),u.return=r,r=u)}return a(r);case E:e:{for(c=o.key;null!==s;){if(s.key===c){if(4===s.tag&&s.stateNode.containerInfo===o.containerInfo&&s.stateNode.implementation===o.implementation){n(r,s.sibling),(s=i(s,o.children||[])).return=r,r=s;break e}n(r,s);break}t(r,s),s=s.sibling}(s=jl(o,r.mode,u)).return=r,r=s}return a(r);case x:return e(r,s,(c=o._init)(o._payload),u)}if(te(o))return m(r,s,o,u);if(L(o))return g(r,s,o,u);ys(r,o)}return"string"==typeof o&&""!==o||"number"==typeof o?(o=""+o,null!==s&&6===s.tag?(n(r,s.sibling),(s=i(s,o)).return=r,r=s):(n(r,s),(s=Fl(o,r.mode,u)).return=r,r=s),a(r)):n(r,s)}}var bs=vs(!0),ws=vs(!1),Es=Ti(null),Ss=null,Ts=null,Cs=null;function Is(){Cs=Ts=Ss=null}function ks(e){var t=Es.current;Ci(Es),e._currentValue=t}function As(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ns(e,t){Ss=e,Cs=Ts=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&t)&&(va=!0),e.firstContext=null)}function Ds(e){var t=e._currentValue;if(Cs!==e)if(e={context:e,memoizedValue:t,next:null},null===Ts){if(null===Ss)throw Error(s(308));Ts=e,Ss.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var Ps=null;function xs(e){null===Ps?Ps=[e]:Ps.push(e)}function Rs(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,xs(t)):(n.next=i.next,i.next=n),t.interleaved=n,Os(e,r)}function Os(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ls=!1;function Ms(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fs(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function js(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Au){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Os(e,n)}return null===(i=r.interleaved)?(t.next=t,xs(r)):(t.next=i.next,i.next=t),r.interleaved=t,Os(e,n)}function Bs(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,_t(e,n)}}function Vs(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?i=s=o:s=s.next=o,n=n.next}while(null!==n);null===s?i=s=t:s=s.next=t}else i=s=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Hs(e,t,n,r){var i=e.updateQueue;Ls=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var u=a,l=u.next;u.next=null,null===o?s=l:o.next=l,o=u;var c=e.alternate;null!==c&&((a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=l:a.next=l,c.lastBaseUpdate=u))}if(null!==s){var h=i.baseState;for(o=0,c=l=u=null,a=s;;){var d=a.lane,f=a.eventTime;if((r&d)===d){null!==c&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(d=t,f=n,m.tag){case 1:if("function"==typeof(p=m.payload)){h=p.call(f,h,d);break e}h=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(d="function"==typeof(p=m.payload)?p.call(f,h,d):p))break e;h=F({},h,d);break e;case 2:Ls=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(d=i.effects)?i.effects=[a]:d.push(a))}else f={eventTime:f,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(l=c=f,u=h):c=c.next=f,o|=d;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(d=a).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}if(null===c&&(u=h),i.baseState=u,i.firstBaseUpdate=l,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===s&&(i.shared.lanes=0);Mu|=o,e.lanes=o,e.memoizedState=h}}function zs(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(s(191,i));i.call(r)}}}var qs={},Gs=Ti(qs),$s=Ti(qs),Ks=Ti(qs);function Ws(e){if(e===qs)throw Error(s(174));return e}function Qs(e,t){switch(Ii(Ks,t),Ii($s,e),Ii(Gs,qs),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ue(null,"");break;default:t=ue(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Ci(Gs),Ii(Gs,t)}function Ys(){Ci(Gs),Ci($s),Ci(Ks)}function Xs(e){Ws(Ks.current);var t=Ws(Gs.current),n=ue(t,e.type);t!==n&&(Ii($s,e),Ii(Gs,n))}function Js(e){$s.current===e&&(Ci(Gs),Ci($s))}var Zs=Ti(0);function eo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=[];function no(){for(var e=0;e<to.length;e++)to[e]._workInProgressVersionPrimary=null;to.length=0}var ro=b.ReactCurrentDispatcher,io=b.ReactCurrentBatchConfig,so=0,oo=null,ao=null,uo=null,lo=!1,co=!1,ho=0,fo=0;function po(){throw Error(s(321))}function mo(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ar(e[n],t[n]))return!1;return!0}function go(e,t,n,r,i,o){if(so=o,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ro.current=null===e||null===e.memoizedState?Zo:ea,e=n(r,i),co){o=0;do{if(co=!1,ho=0,25<=o)throw Error(s(301));o+=1,uo=ao=null,t.updateQueue=null,ro.current=ta,e=n(r,i)}while(co)}if(ro.current=Jo,t=null!==ao&&null!==ao.next,so=0,uo=ao=oo=null,lo=!1,t)throw Error(s(300));return e}function yo(){var e=0!==ho;return ho=0,e}function _o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===uo?oo.memoizedState=uo=e:uo=uo.next=e,uo}function vo(){if(null===ao){var e=oo.alternate;e=null!==e?e.memoizedState:null}else e=ao.next;var t=null===uo?oo.memoizedState:uo.next;if(null!==t)uo=t,ao=e;else{if(null===e)throw Error(s(310));e={memoizedState:(ao=e).memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},null===uo?oo.memoizedState=uo=e:uo=uo.next=e}return uo}function bo(e,t){return"function"==typeof t?t(e):t}function wo(e){var t=vo(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=ao,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){o=i.next,r=r.baseState;var u=a=null,l=null,c=o;do{var h=c.lane;if((so&h)===h)null!==l&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:h,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===l?(u=l=d,a=r):l=l.next=d,oo.lanes|=h,Mu|=h}c=c.next}while(null!==c&&c!==o);null===l?a=r:l.next=u,ar(r,t.memoizedState)||(va=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(null!==(e=n.interleaved)){i=e;do{o=i.lane,oo.lanes|=o,Mu|=o,i=i.next}while(i!==e)}else null===i&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Eo(e){var t=vo(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);ar(o,t.memoizedState)||(va=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function So(){}function To(e,t){var n=oo,r=vo(),i=t(),o=!ar(r.memoizedState,i);if(o&&(r.memoizedState=i,va=!0),r=r.queue,Mo(ko.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||null!==uo&&1&uo.memoizedState.tag){if(n.flags|=2048,Po(9,Io.bind(null,n,r,i,t),void 0,null),null===Nu)throw Error(s(349));30&so||Co(n,t,i)}return i}function Co(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=oo.updateQueue)?(t={lastEffect:null,stores:null},oo.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Io(e,t,n,r){t.value=n,t.getSnapshot=r,Ao(t)&&No(e)}function ko(e,t,n){return n((function(){Ao(t)&&No(e)}))}function Ao(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ar(e,n)}catch(e){return!0}}function No(e){var t=Os(e,1);null!==t&&nl(t,e,1,-1)}function Do(e){var t=_o();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:e},t.queue=e,e=e.dispatch=Wo.bind(null,oo,e),[t.memoizedState,e]}function Po(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=oo.updateQueue)?(t={lastEffect:null,stores:null},oo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function xo(){return vo().memoizedState}function Ro(e,t,n,r){var i=_o();oo.flags|=e,i.memoizedState=Po(1|t,n,void 0,void 0===r?null:r)}function Oo(e,t,n,r){var i=vo();r=void 0===r?null:r;var s=void 0;if(null!==ao){var o=ao.memoizedState;if(s=o.destroy,null!==r&&mo(r,o.deps))return void(i.memoizedState=Po(t,n,s,r))}oo.flags|=e,i.memoizedState=Po(1|t,n,s,r)}function Lo(e,t){return Ro(8390656,8,e,t)}function Mo(e,t){return Oo(2048,8,e,t)}function Fo(e,t){return Oo(4,2,e,t)}function jo(e,t){return Oo(4,4,e,t)}function Uo(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Bo(e,t,n){return n=null!=n?n.concat([e]):null,Oo(4,4,Uo.bind(null,t,e),n)}function Vo(){}function Ho(e,t){var n=vo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function zo(e,t){var n=vo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&mo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function qo(e,t,n){return 21&so?(ar(n,t)||(n=mt(),oo.lanes|=n,Mu|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,va=!0),e.memoizedState=n)}function Go(e,t){var n=vt;vt=0!==n&&4>n?n:4,e(!0);var r=io.transition;io.transition={};try{e(!1),t()}finally{vt=n,io.transition=r}}function $o(){return vo().memoizedState}function Ko(e,t,n){var r=tl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qo(e))Yo(t,n);else if(null!==(n=Rs(e,t,n,r))){nl(n,e,r,el()),Xo(n,t,r)}}function Wo(e,t,n){var r=tl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qo(e))Yo(t,i);else{var s=e.alternate;if(0===e.lanes&&(null===s||0===s.lanes)&&null!==(s=t.lastRenderedReducer))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,ar(a,o)){var u=t.interleaved;return null===u?(i.next=i,xs(t)):(i.next=u.next,u.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=Rs(e,t,i,r))&&(nl(n,e,r,i=el()),Xo(n,t,r))}}function Qo(e){var t=e.alternate;return e===oo||null!==t&&t===oo}function Yo(e,t){co=lo=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xo(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,_t(e,n)}}var Jo={readContext:Ds,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useInsertionEffect:po,useLayoutEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useMutableSource:po,useSyncExternalStore:po,useId:po,unstable_isNewReconciler:!1},Zo={readContext:Ds,useCallback:function(e,t){return _o().memoizedState=[e,void 0===t?null:t],e},useContext:Ds,useEffect:Lo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ro(4194308,4,Uo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ro(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ro(4,2,e,t)},useMemo:function(e,t){var n=_o();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_o();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ko.bind(null,oo,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},_o().memoizedState=e},useState:Do,useDebugValue:Vo,useDeferredValue:function(e){return _o().memoizedState=e},useTransition:function(){var e=Do(!1),t=e[0];return e=Go.bind(null,e[1]),_o().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=oo,i=_o();if(is){if(void 0===n)throw Error(s(407));n=n()}else{if(n=t(),null===Nu)throw Error(s(349));30&so||Co(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Lo(ko.bind(null,r,o,e),[e]),r.flags|=2048,Po(9,Io.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=_o(),t=Nu.identifierPrefix;if(is){var n=Xi;t=":"+t+"R"+(n=(Yi&~(1<<32-ot(Yi)-1)).toString(32)+n),0<(n=ho++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=fo++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ea={readContext:Ds,useCallback:Ho,useContext:Ds,useEffect:Mo,useImperativeHandle:Bo,useInsertionEffect:Fo,useLayoutEffect:jo,useMemo:zo,useReducer:wo,useRef:xo,useState:function(){return wo(bo)},useDebugValue:Vo,useDeferredValue:function(e){return qo(vo(),ao.memoizedState,e)},useTransition:function(){return[wo(bo)[0],vo().memoizedState]},useMutableSource:So,useSyncExternalStore:To,useId:$o,unstable_isNewReconciler:!1},ta={readContext:Ds,useCallback:Ho,useContext:Ds,useEffect:Mo,useImperativeHandle:Bo,useInsertionEffect:Fo,useLayoutEffect:jo,useMemo:zo,useReducer:Eo,useRef:xo,useState:function(){return Eo(bo)},useDebugValue:Vo,useDeferredValue:function(e){var t=vo();return null===ao?t.memoizedState=e:qo(t,ao.memoizedState,e)},useTransition:function(){return[Eo(bo)[0],vo().memoizedState]},useMutableSource:So,useSyncExternalStore:To,useId:$o,unstable_isNewReconciler:!1};function na(e,t){if(e&&e.defaultProps){for(var n in t=F({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function ra(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:F({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var ia={isMounted:function(e){return!!(e=e._reactInternals)&&He(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=el(),i=tl(e),s=js(r,i);s.payload=t,null!=n&&(s.callback=n),null!==(t=Us(e,s,i))&&(nl(t,e,i,r),Bs(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=el(),i=tl(e),s=js(r,i);s.tag=1,s.payload=t,null!=n&&(s.callback=n),null!==(t=Us(e,s,i))&&(nl(t,e,i,r),Bs(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=el(),r=tl(e),i=js(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=Us(e,i,r))&&(nl(t,e,r,n),Bs(t,e,r))}};function sa(e,t,n,r,i,s,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,s,o):!t.prototype||!t.prototype.isPureReactComponent||(!ur(n,r)||!ur(i,s))}function oa(e,t,n){var r=!1,i=ki,s=t.contextType;return"object"==typeof s&&null!==s?s=Ds(s):(i=xi(t)?Di:Ai.current,s=(r=null!=(r=t.contextTypes))?Pi(e,i):ki),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ia,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function aa(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ia.enqueueReplaceState(t,t.state,null)}function ua(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ms(e);var s=t.contextType;"object"==typeof s&&null!==s?i.context=Ds(s):(s=xi(t)?Di:Ai.current,i.context=Pi(e,s)),i.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(ra(e,t,s,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ia.enqueueReplaceState(i,i.state,null),Hs(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function la(e,t){try{var n="",r=t;do{n+=V(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function ca(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ha(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var da="function"==typeof WeakMap?WeakMap:Map;function fa(e,t,n){(n=js(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){qu||(qu=!0,Gu=r),ha(0,t)},n}function pa(e,t,n){(n=js(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ha(0,t)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){ha(0,t),"function"!=typeof r&&(null===$u?$u=new Set([this]):$u.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ma(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new da;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Cl.bind(null,e,t,n),t.then(e,e))}function ga(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ya(e,t,n,r,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=js(-1,1)).tag=2,Us(n,t,1))),n.lanes|=1),e)}var _a=b.ReactCurrentOwner,va=!1;function ba(e,t,n,r){t.child=null===e?ws(t,null,n,r):bs(t,e.child,n,r)}function wa(e,t,n,r,i){n=n.render;var s=t.ref;return Ns(t,i),r=go(e,t,n,r,s,i),n=yo(),null===e||va?(is&&n&&es(t),t.flags|=1,ba(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qa(e,t,i))}function Ea(e,t,n,r,i){if(null===e){var s=n.type;return"function"!=typeof s||xl(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ol(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=s,Sa(e,t,s,r,i))}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if((n=null!==(n=n.compare)?n:ur)(o,r)&&e.ref===t.ref)return qa(e,t,i)}return t.flags|=1,(e=Rl(s,r)).ref=t.ref,e.return=t,t.child=e}function Sa(e,t,n,r,i){if(null!==e){var s=e.memoizedProps;if(ur(s,r)&&e.ref===t.ref){if(va=!1,t.pendingProps=r=s,!(e.lanes&i))return t.lanes=e.lanes,qa(e,t,i);131072&e.flags&&(va=!0)}}return Ia(e,t,n,r,i)}function Ta(e,t,n){var r=t.pendingProps,i=r.children,s=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==s?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ii(Ru,xu),xu|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==s?s.baseLanes:n,Ii(Ru,xu),xu|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Ru,xu),xu|=n;else null!==s?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ii(Ru,xu),xu|=r;return ba(e,t,i,n),t.child}function Ca(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ia(e,t,n,r,i){var s=xi(n)?Di:Ai.current;return s=Pi(t,s),Ns(t,i),n=go(e,t,n,r,s,i),r=yo(),null===e||va?(is&&r&&es(t),t.flags|=1,ba(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,qa(e,t,i))}function ka(e,t,n,r,i){if(xi(n)){var s=!0;Mi(t)}else s=!1;if(Ns(t,i),null===t.stateNode)za(e,t),oa(t,n,r),ua(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var u=o.context,l=n.contextType;"object"==typeof l&&null!==l?l=Ds(l):l=Pi(t,l=xi(n)?Di:Ai.current);var c=n.getDerivedStateFromProps,h="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;h||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==r||u!==l)&&aa(t,o,r,l),Ls=!1;var d=t.memoizedState;o.state=d,Hs(t,r,o,i),u=t.memoizedState,a!==r||d!==u||Ni.current||Ls?("function"==typeof c&&(ra(t,n,c,r),u=t.memoizedState),(a=Ls||sa(t,n,a,r,d,u,l))?(h||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=l,r=a):("function"==typeof o.componentDidMount&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Fs(e,t),a=t.memoizedProps,l=t.type===t.elementType?a:na(t.type,a),o.props=l,h=t.pendingProps,d=o.context,"object"==typeof(u=n.contextType)&&null!==u?u=Ds(u):u=Pi(t,u=xi(n)?Di:Ai.current);var f=n.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==h||d!==u)&&aa(t,o,r,u),Ls=!1,d=t.memoizedState,o.state=d,Hs(t,r,o,i);var p=t.memoizedState;a!==h||d!==p||Ni.current||Ls?("function"==typeof f&&(ra(t,n,f,r),p=t.memoizedState),(l=Ls||sa(t,n,l,r,d,p,u)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,u),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,u)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=u,r=l):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Aa(e,t,n,r,s,i)}function Aa(e,t,n,r,i,s){Ca(e,t);var o=!!(128&t.flags);if(!r&&!o)return i&&Fi(t,n,!1),qa(e,t,s);r=t.stateNode,_a.current=t;var a=o&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&o?(t.child=bs(t,e.child,null,s),t.child=bs(t,null,a,s)):ba(e,t,a,s),t.memoizedState=r.state,i&&Fi(t,n,!0),t.child}function Na(e){var t=e.stateNode;t.pendingContext?Oi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Oi(0,t.context,!1),Qs(e,t.containerInfo)}function Da(e,t,n,r,i){return fs(),ps(i),t.flags|=256,ba(e,t,n,r),t.child}var Pa,xa,Ra,Oa,La={dehydrated:null,treeContext:null,retryLane:0};function Ma(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fa(e,t,n){var r,i=t.pendingProps,o=Zs.current,a=!1,u=!!(128&t.flags);if((r=u)||(r=(null===e||null!==e.memoizedState)&&!!(2&o)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Ii(Zs,1&o),null===e)return ls(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(u=i.children,e=i.fallback,a?(i=t.mode,a=t.child,u={mode:"hidden",children:u},1&i||null===a?a=Ml(u,i,0,null):(a.childLanes=0,a.pendingProps=u),e=Ll(e,i,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ma(n),t.memoizedState=La,e):ja(t,u));if(null!==(o=e.memoizedState)&&null!==(r=o.dehydrated))return function(e,t,n,r,i,o,a){if(n)return 256&t.flags?(t.flags&=-257,Ua(e,t,a,r=ca(Error(s(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Ml({mode:"visible",children:r.children},i,0,null),(o=Ll(o,i,a,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,1&t.mode&&bs(t,e.child,null,a),t.child.memoizedState=Ma(a),t.memoizedState=La,o);if(!(1&t.mode))return Ua(e,t,a,null);if("$!"===i.data){if(r=i.nextSibling&&i.nextSibling.dataset)var u=r.dgst;return r=u,Ua(e,t,a,r=ca(o=Error(s(419)),r,void 0))}if(u=!!(a&e.childLanes),va||u){if(null!==(r=Nu)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=i&(r.suspendedLanes|a)?0:i)&&i!==o.retryLane&&(o.retryLane=i,Os(e,i),nl(r,e,i,-1))}return ml(),Ua(e,t,a,r=ca(Error(s(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=kl.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,rs=li(i.nextSibling),ns=t,is=!0,ss=null,null!==e&&(Ki[Wi++]=Yi,Ki[Wi++]=Xi,Ki[Wi++]=Qi,Yi=e.id,Xi=e.overflow,Qi=t),t=ja(t,r.children),t.flags|=4096,t)}(e,t,u,i,r,o,n);if(a){a=i.fallback,u=t.mode,r=(o=e.child).sibling;var l={mode:"hidden",children:i.children};return 1&u||t.child===o?(i=Rl(o,l)).subtreeFlags=14680064&o.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=l,t.deletions=null),null!==r?a=Rl(r,a):(a=Ll(a,u,n,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,u=null===(u=e.child.memoizedState)?Ma(n):{baseLanes:u.baseLanes|n,cachePool:null,transitions:u.transitions},a.memoizedState=u,a.childLanes=e.childLanes&~n,t.memoizedState=La,i}return e=(a=e.child).sibling,i=Rl(a,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=n),i.return=t,i.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function ja(e,t){return(t=Ml({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ua(e,t,n,r){return null!==r&&ps(r),bs(t,e.child,null,n),(e=ja(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ba(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),As(e.return,t,n)}function Va(e,t,n,r,i){var s=e.memoizedState;null===s?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Ha(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(ba(e,t,r.children,n),2&(r=Zs.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ba(e,n,t);else if(19===e.tag)Ba(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ii(Zs,r),1&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===eo(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Va(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===eo(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Va(t,!0,n,null,s);break;case"together":Va(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function za(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qa(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Mu|=t.lanes,!(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(n=Rl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Rl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Ga(e,t){if(!is)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $a(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ka(e,t,n){var r=t.pendingProps;switch(ts(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $a(t),null;case 1:case 17:return xi(t.type)&&Ri(),$a(t),null;case 3:return r=t.stateNode,Ys(),Ci(Ni),Ci(Ai),no(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(hs(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ss&&(ol(ss),ss=null))),xa(e,t),$a(t),null;case 5:Js(t);var i=Ws(Ks.current);if(n=t.type,null!==e&&null!=t.stateNode)Ra(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(s(166));return $a(t),null}if(e=Ws(Gs.current),hs(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[di]=t,r[fi]=o,e=!!(1&t.mode),n){case"dialog":Ur("cancel",r),Ur("close",r);break;case"iframe":case"object":case"embed":Ur("load",r);break;case"video":case"audio":for(i=0;i<Lr.length;i++)Ur(Lr[i],r);break;case"source":Ur("error",r);break;case"img":case"image":case"link":Ur("error",r),Ur("load",r);break;case"details":Ur("toggle",r);break;case"input":Y(r,o),Ur("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ur("invalid",r);break;case"textarea":ie(r,o),Ur("invalid",r)}for(var u in _e(n,o),i=null,o)if(o.hasOwnProperty(u)){var l=o[u];"children"===u?"string"==typeof l?r.textContent!==l&&(!0!==o.suppressHydrationWarning&&Jr(r.textContent,l,e),i=["children",l]):"number"==typeof l&&r.textContent!==""+l&&(!0!==o.suppressHydrationWarning&&Jr(r.textContent,l,e),i=["children",""+l]):a.hasOwnProperty(u)&&null!=l&&"onScroll"===u&&Ur("scroll",r)}switch(n){case"input":$(r),Z(r,o,!0);break;case"textarea":$(r),oe(r);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(r.onclick=Zr)}r=i,t.updateQueue=r,null!==r&&(t.flags|=4)}else{u=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=u.createElement(n,{is:r.is}):(e=u.createElement(n),"select"===n&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,n),e[di]=t,e[fi]=r,Pa(e,t,!1,!1),t.stateNode=e;e:{switch(u=ve(n,r),n){case"dialog":Ur("cancel",e),Ur("close",e),i=r;break;case"iframe":case"object":case"embed":Ur("load",e),i=r;break;case"video":case"audio":for(i=0;i<Lr.length;i++)Ur(Lr[i],e);i=r;break;case"source":Ur("error",e),i=r;break;case"img":case"image":case"link":Ur("error",e),Ur("load",e),i=r;break;case"details":Ur("toggle",e),i=r;break;case"input":Y(e,r),i=Q(e,r),Ur("invalid",e);break;case"option":default:i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=F({},r,{value:void 0}),Ur("invalid",e);break;case"textarea":ie(e,r),i=re(e,r),Ur("invalid",e)}for(o in _e(n,i),l=i)if(l.hasOwnProperty(o)){var c=l[o];"style"===o?ge(e,c):"dangerouslySetInnerHTML"===o?null!=(c=c?c.__html:void 0)&&he(e,c):"children"===o?"string"==typeof c?("textarea"!==n||""!==c)&&de(e,c):"number"==typeof c&&de(e,""+c):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(a.hasOwnProperty(o)?null!=c&&"onScroll"===o&&Ur("scroll",e):null!=c&&v(e,o,c,u))}switch(n){case"input":$(e),Z(e,r,!1);break;case"textarea":$(e),oe(e);break;case"option":null!=r.value&&e.setAttribute("value",""+q(r.value));break;case"select":e.multiple=!!r.multiple,null!=(o=r.value)?ne(e,!!r.multiple,o,!1):null!=r.defaultValue&&ne(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=Zr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return $a(t),null;case 6:if(e&&null!=t.stateNode)Oa(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(s(166));if(n=Ws(Ks.current),Ws(Gs.current),hs(t)){if(r=t.stateNode,n=t.memoizedProps,r[di]=t,(o=r.nodeValue!==n)&&null!==(e=ns))switch(e.tag){case 3:Jr(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Jr(r.nodeValue,n,!!(1&e.mode))}o&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[di]=t,t.stateNode=r}return $a(t),null;case 13:if(Ci(Zs),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(is&&null!==rs&&1&t.mode&&!(128&t.flags))ds(),fs(),t.flags|=98560,o=!1;else if(o=hs(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(s(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(s(317));o[di]=t}else fs(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;$a(t),o=!1}else null!==ss&&(ol(ss),ss=null),o=!0;if(!o)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Zs.current?0===Ou&&(Ou=3):ml())),null!==t.updateQueue&&(t.flags|=4),$a(t),null);case 4:return Ys(),xa(e,t),null===e&&Hr(t.stateNode.containerInfo),$a(t),null;case 10:return ks(t.type._context),$a(t),null;case 19:if(Ci(Zs),null===(o=t.memoizedState))return $a(t),null;if(r=!!(128&t.flags),null===(u=o.rendering))if(r)Ga(o,!1);else{if(0!==Ou||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(u=eo(e))){for(t.flags|=128,Ga(o,!1),null!==(r=u.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(o=n).flags&=14680066,null===(u=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,e=u.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ii(Zs,1&Zs.current|2),t.child}e=e.sibling}null!==o.tail&&Xe()>Hu&&(t.flags|=128,r=!0,Ga(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=eo(u))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Ga(o,!0),null===o.tail&&"hidden"===o.tailMode&&!u.alternate&&!is)return $a(t),null}else 2*Xe()-o.renderingStartTime>Hu&&1073741824!==n&&(t.flags|=128,r=!0,Ga(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(null!==(n=o.last)?n.sibling=u:t.child=u,o.last=u)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Xe(),t.sibling=null,n=Zs.current,Ii(Zs,r?1&n|2:1&n),t):($a(t),null);case 22:case 23:return hl(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&xu)&&($a(t),6&t.subtreeFlags&&(t.flags|=8192)):$a(t),null;case 24:case 25:return null}throw Error(s(156,t.tag))}function Wa(e,t){switch(ts(t),t.tag){case 1:return xi(t.type)&&Ri(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ys(),Ci(Ni),Ci(Ai),no(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Js(t),null;case 13:if(Ci(Zs),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(s(340));fs()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ci(Zs),null;case 4:return Ys(),null;case 10:return ks(t.type._context),null;case 22:case 23:return hl(),null;default:return null}}Pa=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},xa=function(){},Ra=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ws(Gs.current);var s,o=null;switch(n){case"input":i=Q(e,i),r=Q(e,r),o=[];break;case"select":i=F({},i,{value:void 0}),r=F({},r,{value:void 0}),o=[];break;case"textarea":i=re(e,i),r=re(e,r),o=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=Zr)}for(c in _e(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var u=i[c];for(s in u)u.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(a.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(u=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&l!==u&&(null!=l||null!=u))if("style"===c)if(u){for(s in u)!u.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&u[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,u=u?u.__html:void 0,null!=l&&u!==l&&(o=o||[]).push(c,l)):"children"===c?"string"!=typeof l&&"number"!=typeof l||(o=o||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(a.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&Ur("scroll",e),o||u===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}},Oa=function(e,t,n,r){n!==r&&(t.flags|=4)};var Qa=!1,Ya=!1,Xa="function"==typeof WeakSet?WeakSet:Set,Ja=null;function Za(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Tl(e,t,n)}else n.current=null}function eu(e,t,n){try{n()}catch(n){Tl(e,t,n)}}var tu=!1;function nu(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,void 0!==s&&eu(t,n,s)}i=i.next}while(i!==r)}}function ru(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function iu(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function su(e){var t=e.alternate;null!==t&&(e.alternate=null,su(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[di],delete t[fi],delete t[mi],delete t[gi],delete t[yi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ou(e){return 5===e.tag||3===e.tag||4===e.tag}function au(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ou(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function uu(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Zr));else if(4!==r&&null!==(e=e.child))for(uu(e,t,n),e=e.sibling;null!==e;)uu(e,t,n),e=e.sibling}function lu(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(lu(e,t,n),e=e.sibling;null!==e;)lu(e,t,n),e=e.sibling}var cu=null,hu=!1;function du(e,t,n){for(n=n.child;null!==n;)fu(e,t,n),n=n.sibling}function fu(e,t,n){if(st&&"function"==typeof st.onCommitFiberUnmount)try{st.onCommitFiberUnmount(it,n)}catch(e){}switch(n.tag){case 5:Ya||Za(n,t);case 6:var r=cu,i=hu;cu=null,du(e,t,n),hu=i,null!==(cu=r)&&(hu?(e=cu,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):cu.removeChild(n.stateNode));break;case 18:null!==cu&&(hu?(e=cu,n=n.stateNode,8===e.nodeType?ui(e.parentNode,n):1===e.nodeType&&ui(e,n),Ht(e)):ui(cu,n.stateNode));break;case 4:r=cu,i=hu,cu=n.stateNode.containerInfo,hu=!0,du(e,t,n),cu=r,hu=i;break;case 0:case 11:case 14:case 15:if(!Ya&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,void 0!==o&&(2&s||4&s)&&eu(n,t,o),i=i.next}while(i!==r)}du(e,t,n);break;case 1:if(!Ya&&(Za(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Tl(n,t,e)}du(e,t,n);break;case 21:du(e,t,n);break;case 22:1&n.mode?(Ya=(r=Ya)||null!==n.memoizedState,du(e,t,n),Ya=r):du(e,t,n);break;default:du(e,t,n)}}function pu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Xa),t.forEach((function(t){var r=Al.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function mu(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,u=a;e:for(;null!==u;){switch(u.tag){case 5:cu=u.stateNode,hu=!1;break e;case 3:case 4:cu=u.stateNode.containerInfo,hu=!0;break e}u=u.return}if(null===cu)throw Error(s(160));fu(o,a,i),cu=null,hu=!1;var l=i.alternate;null!==l&&(l.return=null),i.return=null}catch(e){Tl(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gu(t,e),t=t.sibling}function gu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mu(t,e),yu(e),4&r){try{nu(3,e,e.return),ru(3,e)}catch(t){Tl(e,e.return,t)}try{nu(5,e,e.return)}catch(t){Tl(e,e.return,t)}}break;case 1:mu(t,e),yu(e),512&r&&null!==n&&Za(n,n.return);break;case 5:if(mu(t,e),yu(e),512&r&&null!==n&&Za(n,n.return),32&e.flags){var i=e.stateNode;try{de(i,"")}catch(t){Tl(e,e.return,t)}}if(4&r&&null!=(i=e.stateNode)){var o=e.memoizedProps,a=null!==n?n.memoizedProps:o,u=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===u&&"radio"===o.type&&null!=o.name&&X(i,o),ve(u,a);var c=ve(u,o);for(a=0;a<l.length;a+=2){var h=l[a],d=l[a+1];"style"===h?ge(i,d):"dangerouslySetInnerHTML"===h?he(i,d):"children"===h?de(i,d):v(i,h,d,c)}switch(u){case"input":J(i,o);break;case"textarea":se(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var p=o.value;null!=p?ne(i,!!o.multiple,p,!1):f!==!!o.multiple&&(null!=o.defaultValue?ne(i,!!o.multiple,o.defaultValue,!0):ne(i,!!o.multiple,o.multiple?[]:"",!1))}i[fi]=o}catch(t){Tl(e,e.return,t)}}break;case 6:if(mu(t,e),yu(e),4&r){if(null===e.stateNode)throw Error(s(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(t){Tl(e,e.return,t)}}break;case 3:if(mu(t,e),yu(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Ht(t.containerInfo)}catch(t){Tl(e,e.return,t)}break;case 4:default:mu(t,e),yu(e);break;case 13:mu(t,e),yu(e),8192&(i=e.child).flags&&(o=null!==i.memoizedState,i.stateNode.isHidden=o,!o||null!==i.alternate&&null!==i.alternate.memoizedState||(Vu=Xe())),4&r&&pu(e);break;case 22:if(h=null!==n&&null!==n.memoizedState,1&e.mode?(Ya=(c=Ya)||h,mu(t,e),Ya=c):mu(t,e),yu(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!h&&1&e.mode)for(Ja=e,h=e.child;null!==h;){for(d=Ja=h;null!==Ja;){switch(p=(f=Ja).child,f.tag){case 0:case 11:case 14:case 15:nu(4,f,f.return);break;case 1:Za(f,f.return);var m=f.stateNode;if("function"==typeof m.componentWillUnmount){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(e){Tl(r,n,e)}}break;case 5:Za(f,f.return);break;case 22:if(null!==f.memoizedState){wu(d);continue}}null!==p?(p.return=f,Ja=p):wu(d)}h=h.sibling}e:for(h=null,d=e;;){if(5===d.tag){if(null===h){h=d;try{i=d.stateNode,c?"function"==typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none":(u=d.stateNode,a=null!=(l=d.memoizedProps.style)&&l.hasOwnProperty("display")?l.display:null,u.style.display=me("display",a))}catch(t){Tl(e,e.return,t)}}}else if(6===d.tag){if(null===h)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(t){Tl(e,e.return,t)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;h===d&&(h=null),d=d.return}h===d&&(h=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:mu(t,e),yu(e),4&r&&pu(e);case 21:}}function yu(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(ou(n)){var r=n;break e}n=n.return}throw Error(s(160))}switch(r.tag){case 5:var i=r.stateNode;32&r.flags&&(de(i,""),r.flags&=-33),lu(e,au(e),i);break;case 3:case 4:var o=r.stateNode.containerInfo;uu(e,au(e),o);break;default:throw Error(s(161))}}catch(t){Tl(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function _u(e,t,n){Ja=e,vu(e,t,n)}function vu(e,t,n){for(var r=!!(1&e.mode);null!==Ja;){var i=Ja,s=i.child;if(22===i.tag&&r){var o=null!==i.memoizedState||Qa;if(!o){var a=i.alternate,u=null!==a&&null!==a.memoizedState||Ya;a=Qa;var l=Ya;if(Qa=o,(Ya=u)&&!l)for(Ja=i;null!==Ja;)u=(o=Ja).child,22===o.tag&&null!==o.memoizedState?Eu(i):null!==u?(u.return=o,Ja=u):Eu(i);for(;null!==s;)Ja=s,vu(s,t,n),s=s.sibling;Ja=i,Qa=a,Ya=l}bu(e)}else 8772&i.subtreeFlags&&null!==s?(s.return=i,Ja=s):bu(e)}}function bu(e){for(;null!==Ja;){var t=Ja;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ya||ru(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Ya)if(null===n)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:na(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&zs(t,o,r);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}zs(t,a,n)}break;case 5:var u=t.stateNode;if(null===n&&4&t.flags){n=u;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var h=c.memoizedState;if(null!==h){var d=h.dehydrated;null!==d&&Ht(d)}}}break;default:throw Error(s(163))}Ya||512&t.flags&&iu(t)}catch(e){Tl(t,t.return,e)}}if(t===e){Ja=null;break}if(null!==(n=t.sibling)){n.return=t.return,Ja=n;break}Ja=t.return}}function wu(e){for(;null!==Ja;){var t=Ja;if(t===e){Ja=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ja=n;break}Ja=t.return}}function Eu(e){for(;null!==Ja;){var t=Ja;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ru(4,t)}catch(e){Tl(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){Tl(t,i,e)}}var s=t.return;try{iu(t)}catch(e){Tl(t,s,e)}break;case 5:var o=t.return;try{iu(t)}catch(e){Tl(t,o,e)}}}catch(e){Tl(t,t.return,e)}if(t===e){Ja=null;break}var a=t.sibling;if(null!==a){a.return=t.return,Ja=a;break}Ja=t.return}}var Su,Tu=Math.ceil,Cu=b.ReactCurrentDispatcher,Iu=b.ReactCurrentOwner,ku=b.ReactCurrentBatchConfig,Au=0,Nu=null,Du=null,Pu=0,xu=0,Ru=Ti(0),Ou=0,Lu=null,Mu=0,Fu=0,ju=0,Uu=null,Bu=null,Vu=0,Hu=1/0,zu=null,qu=!1,Gu=null,$u=null,Ku=!1,Wu=null,Qu=0,Yu=0,Xu=null,Ju=-1,Zu=0;function el(){return 6&Au?Xe():-1!==Ju?Ju:Ju=Xe()}function tl(e){return 1&e.mode?2&Au&&0!==Pu?Pu&-Pu:null!==ms.transition?(0===Zu&&(Zu=mt()),Zu):0!==(e=vt)?e:e=void 0===(e=window.event)?16:Yt(e.type):1}function nl(e,t,n,r){if(50<Yu)throw Yu=0,Xu=null,Error(s(185));yt(e,n,r),2&Au&&e===Nu||(e===Nu&&(!(2&Au)&&(Fu|=n),4===Ou&&al(e,Pu)),rl(e,r),1===n&&0===Au&&!(1&t.mode)&&(Hu=Xe()+500,Ui&&Hi()))}function rl(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-ot(s),a=1<<o,u=i[o];-1===u?a&n&&!(a&r)||(i[o]=ft(a,t)):u<=t&&(e.expiredLanes|=a),s&=~a}}(e,t);var r=dt(e,e===Nu?Pu:0);if(0===r)null!==n&&We(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&We(n),1===t)0===e.tag?function(e){Ui=!0,Vi(e)}(ul.bind(null,e)):Vi(ul.bind(null,e)),oi((function(){!(6&Au)&&Hi()})),n=null;else{switch(bt(r)){case 1:n=Ze;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=rt}n=Nl(n,il.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function il(e,t){if(Ju=-1,Zu=0,6&Au)throw Error(s(327));var n=e.callbackNode;if(El()&&e.callbackNode!==n)return null;var r=dt(e,e===Nu?Pu:0);if(0===r)return null;if(30&r||r&e.expiredLanes||t)t=gl(e,r);else{t=r;var i=Au;Au|=2;var o=pl();for(Nu===e&&Pu===t||(zu=null,Hu=Xe()+500,dl(e,t));;)try{_l();break}catch(t){fl(e,t)}Is(),Cu.current=o,Au=i,null!==Du?t=0:(Nu=null,Pu=0,t=Ou)}if(0!==t){if(2===t&&(0!==(i=pt(e))&&(r=i,t=sl(e,i))),1===t)throw n=Lu,dl(e,0),al(e,r),rl(e,Xe()),n;if(6===t)al(e,r);else{if(i=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!ar(s(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=gl(e,r),2===t&&(o=pt(e),0!==o&&(r=o,t=sl(e,o))),1!==t)))throw n=Lu,dl(e,0),al(e,r),rl(e,Xe()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(s(345));case 2:case 5:wl(e,Bu,zu);break;case 3:if(al(e,r),(130023424&r)===r&&10<(t=Vu+500-Xe())){if(0!==dt(e,0))break;if(((i=e.suspendedLanes)&r)!==r){el(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ri(wl.bind(null,e,Bu,zu),t);break}wl(e,Bu,zu);break;case 4:if(al(e,r),(4194240&r)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-ot(r);o=1<<a,(a=t[a])>i&&(i=a),r&=~o}if(r=i,10<(r=(120>(r=Xe()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Tu(r/1960))-r)){e.timeoutHandle=ri(wl.bind(null,e,Bu,zu),r);break}wl(e,Bu,zu);break;default:throw Error(s(329))}}}return rl(e,Xe()),e.callbackNode===n?il.bind(null,e):null}function sl(e,t){var n=Uu;return e.current.memoizedState.isDehydrated&&(dl(e,t).flags|=256),2!==(e=gl(e,t))&&(t=Bu,Bu=n,null!==t&&ol(t)),e}function ol(e){null===Bu?Bu=e:Bu.push.apply(Bu,e)}function al(e,t){for(t&=~ju,t&=~Fu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ot(t),r=1<<n;e[n]=-1,t&=~r}}function ul(e){if(6&Au)throw Error(s(327));El();var t=dt(e,0);if(!(1&t))return rl(e,Xe()),null;var n=gl(e,t);if(0!==e.tag&&2===n){var r=pt(e);0!==r&&(t=r,n=sl(e,r))}if(1===n)throw n=Lu,dl(e,0),al(e,t),rl(e,Xe()),n;if(6===n)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wl(e,Bu,zu),rl(e,Xe()),null}function ll(e,t){var n=Au;Au|=1;try{return e(t)}finally{0===(Au=n)&&(Hu=Xe()+500,Ui&&Hi())}}function cl(e){null!==Wu&&0===Wu.tag&&!(6&Au)&&El();var t=Au;Au|=1;var n=ku.transition,r=vt;try{if(ku.transition=null,vt=1,e)return e()}finally{vt=r,ku.transition=n,!(6&(Au=t))&&Hi()}}function hl(){xu=Ru.current,Ci(Ru)}function dl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ii(n)),null!==Du)for(n=Du.return;null!==n;){var r=n;switch(ts(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Ri();break;case 3:Ys(),Ci(Ni),Ci(Ai),no();break;case 5:Js(r);break;case 4:Ys();break;case 13:case 19:Ci(Zs);break;case 10:ks(r.type._context);break;case 22:case 23:hl()}n=n.return}if(Nu=e,Du=e=Rl(e.current,null),Pu=xu=t,Ou=0,Lu=null,ju=Fu=Mu=0,Bu=Uu=null,null!==Ps){for(t=0;t<Ps.length;t++)if(null!==(r=(n=Ps[t]).interleaved)){n.interleaved=null;var i=r.next,s=n.pending;if(null!==s){var o=s.next;s.next=i,r.next=o}n.pending=r}Ps=null}return e}function fl(e,t){for(;;){var n=Du;try{if(Is(),ro.current=Jo,lo){for(var r=oo.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}lo=!1}if(so=0,uo=ao=oo=null,co=!1,ho=0,Iu.current=null,null===n||null===n.return){Ou=1,Lu=t,Du=null;break}e:{var o=e,a=n.return,u=n,l=t;if(t=Pu,u.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l,h=u,d=h.tag;if(!(1&h.mode||0!==d&&11!==d&&15!==d)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var p=ga(a);if(null!==p){p.flags&=-257,ya(p,a,u,0,t),1&p.mode&&ma(o,c,t),l=c;var m=(t=p).updateQueue;if(null===m){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}if(!(1&t)){ma(o,c,t),ml();break e}l=Error(s(426))}else if(is&&1&u.mode){var y=ga(a);if(null!==y){!(65536&y.flags)&&(y.flags|=256),ya(y,a,u,0,t),ps(la(l,u));break e}}o=l=la(l,u),4!==Ou&&(Ou=2),null===Uu?Uu=[o]:Uu.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,Vs(o,fa(0,l,t));break e;case 1:u=l;var _=o.type,v=o.stateNode;if(!(128&o.flags||"function"!=typeof _.getDerivedStateFromError&&(null===v||"function"!=typeof v.componentDidCatch||null!==$u&&$u.has(v)))){o.flags|=65536,t&=-t,o.lanes|=t,Vs(o,pa(o,u,t));break e}}o=o.return}while(null!==o)}bl(n)}catch(e){t=e,Du===n&&null!==n&&(Du=n=n.return);continue}break}}function pl(){var e=Cu.current;return Cu.current=Jo,null===e?Jo:e}function ml(){0!==Ou&&3!==Ou&&2!==Ou||(Ou=4),null===Nu||!(268435455&Mu)&&!(268435455&Fu)||al(Nu,Pu)}function gl(e,t){var n=Au;Au|=2;var r=pl();for(Nu===e&&Pu===t||(zu=null,dl(e,t));;)try{yl();break}catch(t){fl(e,t)}if(Is(),Au=n,Cu.current=r,null!==Du)throw Error(s(261));return Nu=null,Pu=0,Ou}function yl(){for(;null!==Du;)vl(Du)}function _l(){for(;null!==Du&&!Qe();)vl(Du)}function vl(e){var t=Su(e.alternate,e,xu);e.memoizedProps=e.pendingProps,null===t?bl(e):Du=t,Iu.current=null}function bl(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Wa(n,t)))return n.flags&=32767,void(Du=n);if(null===e)return Ou=6,void(Du=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Ka(n,t,xu)))return void(Du=n);if(null!==(t=t.sibling))return void(Du=t);Du=t=e}while(null!==t);0===Ou&&(Ou=5)}function wl(e,t,n){var r=vt,i=ku.transition;try{ku.transition=null,vt=1,function(e,t,n,r){do{El()}while(null!==Wu);if(6&Au)throw Error(s(327));n=e.finishedWork;var i=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-ot(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}(e,o),e===Nu&&(Du=Nu=null,Pu=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Ku||(Ku=!0,Nl(tt,(function(){return El(),null}))),o=!!(15990&n.flags),!!(15990&n.subtreeFlags)||o){o=ku.transition,ku.transition=null;var a=vt;vt=1;var u=Au;Au|=4,Iu.current=null,function(e,t){if(ei=qt,fr(e=dr())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(e){n=null;break e}var a=0,u=-1,l=-1,c=0,h=0,d=e,f=null;t:for(;;){for(var p;d!==n||0!==i&&3!==d.nodeType||(u=a+i),d!==o||0!==r&&3!==d.nodeType||(l=a+r),3===d.nodeType&&(a+=d.nodeValue.length),null!==(p=d.firstChild);)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===i&&(u=a),f===o&&++h===r&&(l=a),null!==(p=d.nextSibling))break;f=(d=f).parentNode}d=p}n=-1===u||-1===l?null:{start:u,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ti={focusedElem:e,selectionRange:n},qt=!1,Ja=t;null!==Ja;)if(e=(t=Ja).child,1028&t.subtreeFlags&&null!==e)e.return=t,Ja=e;else for(;null!==Ja;){t=Ja;try{var m=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,y=m.memoizedState,_=t.stateNode,v=_.getSnapshotBeforeUpdate(t.elementType===t.type?g:na(t.type,g),y);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(s(163))}}catch(e){Tl(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Ja=e;break}Ja=t.return}m=tu,tu=!1}(e,n),gu(n,e),pr(ti),qt=!!ei,ti=ei=null,e.current=n,_u(n,e,i),Ye(),Au=u,vt=a,ku.transition=o}else e.current=n;if(Ku&&(Ku=!1,Wu=e,Qu=i),o=e.pendingLanes,0===o&&($u=null),function(e){if(st&&"function"==typeof st.onCommitFiberRoot)try{st.onCommitFiberRoot(it,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),rl(e,Xe()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(qu)throw qu=!1,e=Gu,Gu=null,e;!!(1&Qu)&&0!==e.tag&&El(),o=e.pendingLanes,1&o?e===Xu?Yu++:(Yu=0,Xu=e):Yu=0,Hi()}(e,t,n,r)}finally{ku.transition=i,vt=r}return null}function El(){if(null!==Wu){var e=bt(Qu),t=ku.transition,n=vt;try{if(ku.transition=null,vt=16>e?16:e,null===Wu)var r=!1;else{if(e=Wu,Wu=null,Qu=0,6&Au)throw Error(s(331));var i=Au;for(Au|=4,Ja=e.current;null!==Ja;){var o=Ja,a=o.child;if(16&Ja.flags){var u=o.deletions;if(null!==u){for(var l=0;l<u.length;l++){var c=u[l];for(Ja=c;null!==Ja;){var h=Ja;switch(h.tag){case 0:case 11:case 15:nu(8,h,o)}var d=h.child;if(null!==d)d.return=h,Ja=d;else for(;null!==Ja;){var f=(h=Ja).sibling,p=h.return;if(su(h),h===c){Ja=null;break}if(null!==f){f.return=p,Ja=f;break}Ja=p}}}var m=o.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(null!==g)}}Ja=o}}if(2064&o.subtreeFlags&&null!==a)a.return=o,Ja=a;else e:for(;null!==Ja;){if(2048&(o=Ja).flags)switch(o.tag){case 0:case 11:case 15:nu(9,o,o.return)}var _=o.sibling;if(null!==_){_.return=o.return,Ja=_;break e}Ja=o.return}}var v=e.current;for(Ja=v;null!==Ja;){var b=(a=Ja).child;if(2064&a.subtreeFlags&&null!==b)b.return=a,Ja=b;else e:for(a=v;null!==Ja;){if(2048&(u=Ja).flags)try{switch(u.tag){case 0:case 11:case 15:ru(9,u)}}catch(e){Tl(u,u.return,e)}if(u===a){Ja=null;break e}var w=u.sibling;if(null!==w){w.return=u.return,Ja=w;break e}Ja=u.return}}if(Au=i,Hi(),st&&"function"==typeof st.onPostCommitFiberRoot)try{st.onPostCommitFiberRoot(it,e)}catch(e){}r=!0}return r}finally{vt=n,ku.transition=t}}return!1}function Sl(e,t,n){e=Us(e,t=fa(0,t=la(n,t),1),1),t=el(),null!==e&&(yt(e,1,t),rl(e,t))}function Tl(e,t,n){if(3===e.tag)Sl(e,e,n);else for(;null!==t;){if(3===t.tag){Sl(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===$u||!$u.has(r))){t=Us(t,e=pa(t,e=la(n,e),1),1),e=el(),null!==t&&(yt(t,1,e),rl(t,e));break}}t=t.return}}function Cl(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=el(),e.pingedLanes|=e.suspendedLanes&n,Nu===e&&(Pu&n)===n&&(4===Ou||3===Ou&&(130023424&Pu)===Pu&&500>Xe()-Vu?dl(e,0):ju|=n),rl(e,t)}function Il(e,t){0===t&&(1&e.mode?(t=ct,!(130023424&(ct<<=1))&&(ct=4194304)):t=1);var n=el();null!==(e=Os(e,t))&&(yt(e,t,n),rl(e,n))}function kl(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Il(e,n)}function Al(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;null!==i&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(s(314))}null!==r&&r.delete(t),Il(e,n)}function Nl(e,t){return Ke(e,t)}function Dl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pl(e,t,n,r){return new Dl(e,t,n,r)}function xl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rl(e,t){var n=e.alternate;return null===n?((n=Pl(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ol(e,t,n,r,i,o){var a=2;if(r=e,"function"==typeof e)xl(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case S:return Ll(n.children,i,o,t);case T:a=8,i|=8;break;case C:return(e=Pl(12,n,t,2|i)).elementType=C,e.lanes=o,e;case N:return(e=Pl(13,n,t,i)).elementType=N,e.lanes=o,e;case D:return(e=Pl(19,n,t,i)).elementType=D,e.lanes=o,e;case R:return Ml(n,i,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case I:a=10;break e;case k:a=9;break e;case A:a=11;break e;case P:a=14;break e;case x:a=16,r=null;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=Pl(a,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Ll(e,t,n,r){return(e=Pl(7,e,r,t)).lanes=n,e}function Ml(e,t,n,r){return(e=Pl(22,e,r,t)).elementType=R,e.lanes=n,e.stateNode={isHidden:!1},e}function Fl(e,t,n){return(e=Pl(6,e,null,t)).lanes=n,e}function jl(e,t,n){return(t=Pl(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ul(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Bl(e,t,n,r,i,s,o,a,u){return e=new Ul(e,t,n,a,u),1===t?(t=1,!0===s&&(t|=8)):t=0,s=Pl(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ms(s),e}function Vl(e){if(!e)return ki;e:{if(He(e=e._reactInternals)!==e||1!==e.tag)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(s(171))}if(1===e.tag){var n=e.type;if(xi(n))return Li(e,n,t)}return t}function Hl(e,t,n,r,i,s,o,a,u){return(e=Bl(n,r,!0,e,0,s,0,a,u)).context=Vl(null),n=e.current,(s=js(r=el(),i=tl(n))).callback=null!=t?t:null,Us(n,s,i),e.current.lanes=i,yt(e,i,r),rl(e,r),e}function zl(e,t,n,r){var i=t.current,s=el(),o=tl(i);return n=Vl(n),null===t.context?t.context=n:t.pendingContext=n,(t=js(s,o)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Us(i,t,o))&&(nl(e,i,o,s),Bs(e,i,o)),o}function ql(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Gl(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function $l(e,t){Gl(e,t),(e=e.alternate)&&Gl(e,t)}Su=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ni.current)va=!0;else{if(!(e.lanes&n||128&t.flags))return va=!1,function(e,t,n){switch(t.tag){case 3:Na(t),fs();break;case 5:Xs(t);break;case 1:xi(t.type)&&Mi(t);break;case 4:Qs(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ii(Es,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ii(Zs,1&Zs.current),t.flags|=128,null):n&t.child.childLanes?Fa(e,t,n):(Ii(Zs,1&Zs.current),null!==(e=qa(e,t,n))?e.sibling:null);Ii(Zs,1&Zs.current);break;case 19:if(r=!!(n&t.childLanes),128&e.flags){if(r)return Ha(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ii(Zs,Zs.current),r)break;return null;case 22:case 23:return t.lanes=0,Ta(e,t,n)}return qa(e,t,n)}(e,t,n);va=!!(131072&e.flags)}else va=!1,is&&1048576&t.flags&&Zi(t,$i,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;za(e,t),e=t.pendingProps;var i=Pi(t,Ai.current);Ns(t,n),i=go(null,t,r,e,i,n);var o=yo();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xi(r)?(o=!0,Mi(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Ms(t),i.updater=ia,t.stateNode=i,i._reactInternals=t,ua(t,r,e,n),t=Aa(null,t,r,!0,o,n)):(t.tag=0,is&&o&&es(t),ba(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(za(e,t),e=t.pendingProps,r=(i=r._init)(r._payload),t.type=r,i=t.tag=function(e){if("function"==typeof e)return xl(e)?1:0;if(null!=e){if((e=e.$$typeof)===A)return 11;if(e===P)return 14}return 2}(r),e=na(r,e),i){case 0:t=Ia(null,t,r,e,n);break e;case 1:t=ka(null,t,r,e,n);break e;case 11:t=wa(null,t,r,e,n);break e;case 14:t=Ea(null,t,r,na(r.type,e),n);break e}throw Error(s(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,Ia(e,t,r,i=t.elementType===r?i:na(r,i),n);case 1:return r=t.type,i=t.pendingProps,ka(e,t,r,i=t.elementType===r?i:na(r,i),n);case 3:e:{if(Na(t),null===e)throw Error(s(387));r=t.pendingProps,i=(o=t.memoizedState).element,Fs(e,t),Hs(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Da(e,t,r,n,i=la(Error(s(423)),t));break e}if(r!==i){t=Da(e,t,r,n,i=la(Error(s(424)),t));break e}for(rs=li(t.stateNode.containerInfo.firstChild),ns=t,is=!0,ss=null,n=ws(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(fs(),r===i){t=qa(e,t,n);break e}ba(e,t,r,n)}t=t.child}return t;case 5:return Xs(t),null===e&&ls(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,ni(r,i)?a=null:null!==o&&ni(r,o)&&(t.flags|=32),Ca(e,t),ba(e,t,a,n),t.child;case 6:return null===e&&ls(t),null;case 13:return Fa(e,t,n);case 4:return Qs(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=bs(t,null,r,n):ba(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,wa(e,t,r,i=t.elementType===r?i:na(r,i),n);case 7:return ba(e,t,t.pendingProps,n),t.child;case 8:case 12:return ba(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Ii(Es,r._currentValue),r._currentValue=a,null!==o)if(ar(o.value,a)){if(o.children===i.children&&!Ni.current){t=qa(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var u=o.dependencies;if(null!==u){a=o.child;for(var l=u.firstContext;null!==l;){if(l.context===r){if(1===o.tag){(l=js(-1,n&-n)).tag=2;var c=o.updateQueue;if(null!==c){var h=(c=c.shared).pending;null===h?l.next=l:(l.next=h.next,h.next=l),c.pending=l}}o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),As(o.return,n,t),u.lanes|=n;break}l=l.next}}else if(10===o.tag)a=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(a=o.return))throw Error(s(341));a.lanes|=n,null!==(u=a.alternate)&&(u.lanes|=n),As(a,n,t),a=o.sibling}else a=o.child;if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===t){a=null;break}if(null!==(o=a.sibling)){o.return=a.return,a=o;break}a=a.return}o=a}ba(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ns(t,n),r=r(i=Ds(i)),t.flags|=1,ba(e,t,r,n),t.child;case 14:return i=na(r=t.type,t.pendingProps),Ea(e,t,r,i=na(r.type,i),n);case 15:return Sa(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:na(r,i),za(e,t),t.tag=1,xi(r)?(e=!0,Mi(t)):e=!1,Ns(t,n),oa(t,r,i),ua(t,r,i,n),Aa(null,t,r,!0,e,n);case 19:return Ha(e,t,n);case 22:return Ta(e,t,n)}throw Error(s(156,t.tag))};var Kl="function"==typeof reportError?reportError:function(e){console.error(e)};function Wl(e){this._internalRoot=e}function Ql(e){this._internalRoot=e}function Yl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Xl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Jl(){}function Zl(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if("function"==typeof i){var a=i;i=function(){var e=ql(o);a.call(e)}}zl(t,o,e,i)}else o=function(e,t,n,r,i){if(i){if("function"==typeof r){var s=r;r=function(){var e=ql(o);s.call(e)}}var o=Hl(t,r,e,0,null,!1,0,"",Jl);return e._reactRootContainer=o,e[pi]=o.current,Hr(8===e.nodeType?e.parentNode:e),cl(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var a=r;r=function(){var e=ql(u);a.call(e)}}var u=Bl(e,0,!1,null,0,!1,0,"",Jl);return e._reactRootContainer=u,e[pi]=u.current,Hr(8===e.nodeType?e.parentNode:e),cl((function(){zl(t,u,n,r)})),u}(n,t,e,i,r);return ql(o)}Ql.prototype.render=Wl.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(s(409));zl(e,t,null,null)},Ql.prototype.unmount=Wl.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;cl((function(){zl(null,e,null,null)})),t[pi]=null}},Ql.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&0!==t&&t<Rt[n].priority;n++);Rt.splice(n,0,e),0===n&&Ft(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ht(t.pendingLanes);0!==n&&(_t(t,1|n),rl(t,Xe()),!(6&Au)&&(Hu=Xe()+500,Hi()))}break;case 13:cl((function(){var t=Os(e,1);if(null!==t){var n=el();nl(t,e,1,n)}})),$l(e,1)}},Et=function(e){if(13===e.tag){var t=Os(e,134217728);if(null!==t)nl(t,e,134217728,el());$l(e,134217728)}},St=function(e){if(13===e.tag){var t=tl(e),n=Os(e,t);if(null!==n)nl(n,e,t,el());$l(e,t)}},Tt=function(){return vt},Ct=function(e,t){var n=vt;try{return vt=e,t()}finally{vt=n}},Ee=function(e,t,n){switch(t){case"input":if(J(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=wi(r);if(!i)throw Error(s(90));K(r),J(r,i)}}}break;case"textarea":se(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},Ae=ll,Ne=cl;var ec={usingClientEntryPoint:!1,Events:[vi,bi,wi,Ie,ke,ll]},tc={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nc={bundleType:tc.bundleType,version:tc.version,rendererPackageName:tc.rendererPackageName,rendererConfig:tc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ge(e))?null:e.stateNode},findFiberByHostInstance:tc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{it=rc.inject(nc),st=rc}catch(ce){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ec,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yl(t))throw Error(s(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!Yl(e))throw Error(s(299));var n=!1,r="",i=Kl;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Bl(e,1,!1,null,0,n,0,r,i),e[pi]=t.current,Hr(8===e.nodeType?e.parentNode:e),new Wl(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(s(188));throw e=Object.keys(e).join(","),Error(s(268,e))}return e=null===(e=Ge(t))?null:e.stateNode},t.flushSync=function(e){return cl(e)},t.hydrate=function(e,t,n){if(!Xl(t))throw Error(s(200));return Zl(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!Yl(e))throw Error(s(405));var r=null!=n&&n.hydratedSources||null,i=!1,o="",a=Kl;if(null!=n&&(!0===n.unstable_strictMode&&(i=!0),void 0!==n.identifierPrefix&&(o=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=Hl(t,null,e,1,null!=n?n:null,i,0,o,a),e[pi]=t.current,Hr(e),r)for(e=0;e<r.length;e++)i=(i=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Ql(t)},t.render=function(e,t,n){if(!Xl(t))throw Error(s(200));return Zl(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Xl(e))throw Error(s(40));return!!e._reactRootContainer&&(cl((function(){Zl(null,null,e,!1,(function(){e._reactRootContainer=null,e[pi]=null}))})),!0)},t.unstable_batchedUpdates=ll,t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Xl(n))throw Error(s(200));if(null==e||void 0===e._reactInternals)throw Error(s(38));return Zl(e,t,n,!1,r)},t.version="18.3.1-next-f1338f8080-20240426"},"./node_modules/react-dom/client.js":function(e,t,n){"use strict";var r=n("./node_modules/react-dom/index.js");t.H=r.createRoot,r.hydrateRoot},"./node_modules/react-dom/index.js":function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n("./node_modules/react-dom/cjs/react-dom.production.min.js")},"./node_modules/react-intl/lib/src/components/injectIntl.js":function(e,t,n){"use strict";n.d(t,{Kq:function(){return s},ob:function(){return o}});var r=n("./node_modules/react/index.js");n("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js");var i="undefined"==typeof window||window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?r.createContext(null):window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=r.createContext(null)),s=(i.Consumer,i.Provider),o=i},"./node_modules/react-intl/lib/src/components/message.js":function(e,t,n){"use strict";var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/react/index.js"),s=n("./node_modules/react-intl/lib/src/components/useIntl.js"),o=n("./node_modules/react-intl/lib/src/utils.js");function a(e){var t=(0,s.A)(),n=t.formatMessage,r=t.textComponent,o=void 0===r?i.Fragment:r,a=e.id,u=e.description,l=e.defaultMessage,c=e.values,h=e.children,d=e.tagName,f=void 0===d?o:d,p=n({id:a,description:u,defaultMessage:l},c,{ignoreTag:e.ignoreTag});return"function"==typeof h?h(Array.isArray(p)?p:[p]):f?i.createElement(f,null,i.Children.toArray(p)):i.createElement(i.Fragment,null,p)}a.displayName="FormattedMessage";var u=i.memo(a,(function(e,t){var n=e.values,i=(0,r.__rest)(e,["values"]),s=t.values,a=(0,r.__rest)(t,["values"]);return(0,o.bN)(s,n)&&(0,o.bN)(i,a)}));u.displayName="MemoizedFormattedMessage",t.A=u},"./node_modules/react-intl/lib/src/components/provider.js":function(e,t,n){"use strict";n.d(t,{A:function(){return g}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/@formatjs/intl/lib/src/utils.js"),s=n("./node_modules/react/index.js"),o=n("./node_modules/react-intl/lib/src/utils.js"),a=n("./node_modules/react-intl/lib/src/components/injectIntl.js"),u=n("./node_modules/@formatjs/intl/lib/src/message.js"),l=n("./node_modules/@formatjs/intl/lib/src/create-intl.js"),c=n("./node_modules/intl-messageformat/lib/src/formatters.js");function h(e){return e?Object.keys(e).reduce((function(t,n){var r=e[n];return t[n]=(0,c.RK)(r)?(0,o.yU)(r):r,t}),{}):e}var d=function(e,t,n,i){for(var o=[],a=4;a<arguments.length;a++)o[a-4]=arguments[a];var l=h(i),c=u.h.apply(void 0,(0,r.__spreadArray)([e,t,n,l],o,!1));return Array.isArray(c)?s.Children.toArray(c):c},f=function(e,t){var n=e.defaultRichTextElements,i=(0,r.__rest)(e,["defaultRichTextElements"]),s=h(n),a=(0,l.E)((0,r.__assign)((0,r.__assign)((0,r.__assign)({},o.JF),i),{defaultRichTextElements:s}),t),u={locale:a.locale,timeZone:a.timeZone,fallbackOnEmptyString:a.fallbackOnEmptyString,formats:a.formats,defaultLocale:a.defaultLocale,defaultFormats:a.defaultFormats,messages:a.messages,onError:a.onError,defaultRichTextElements:s};return(0,r.__assign)((0,r.__assign)({},a),{formatMessage:d.bind(null,u,a.formatters),$t:d.bind(null,u,a.formatters)})};function p(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.cache=(0,i.MT)(),t.state={cache:t.cache,intl:f(p(t.props),t.cache),prevConfig:p(t.props)},t}return(0,r.__extends)(t,e),t.getDerivedStateFromProps=function(e,t){var n=t.prevConfig,r=t.cache,i=p(e);return(0,o.bN)(n,i)?null:{intl:f(i,r),prevConfig:i}},t.prototype.render=function(){return(0,o.HM)(this.state.intl),s.createElement(a.Kq,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=o.JF,t}(s.PureComponent),g=m},"./node_modules/react-intl/lib/src/components/useIntl.js":function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n("./node_modules/react/index.js"),i=n("./node_modules/react-intl/lib/src/components/injectIntl.js"),s=n("./node_modules/react-intl/lib/src/utils.js");function o(){var e=r.useContext(i.ob);return(0,s.HM)(e),e}},"./node_modules/react-intl/lib/src/utils.js":function(e,t,n){"use strict";n.d(t,{HM:function(){return a},JF:function(){return u},bN:function(){return c},yU:function(){return l}});var r=n("./node_modules/tslib/tslib.es6.mjs"),i=n("./node_modules/react/index.js"),s=n("./node_modules/@formatjs/ecma402-abstract/lib/utils.js"),o=n("./node_modules/@formatjs/intl/lib/src/utils.js");function a(e){(0,s.V1)(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var u=(0,r.__assign)((0,r.__assign)({},o.JF),{textComponent:i.Fragment});function l(e){return function(t){return e(i.Children.toArray(t))}}function c(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var s=0;s<i;s++){var o=n[s];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0}},"./node_modules/react-intl/src/components/injectIntl.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.Provider=void 0;var r=n("./node_modules/tslib/tslib.es6.mjs"),i=r.__importStar(n("./node_modules/react/index.js")),s=r.__importDefault(n("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js")),o=n("./node_modules/react-intl/src/utils.js");var a="undefined"==typeof window||window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?i.createContext(null):window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=i.createContext(null)),u=a.Consumer,l=a.Provider;t.Provider=l,t.Context=a,t.default=function(e,t){var n=t||{},a=n.intlPropName,l=void 0===a?"intl":a,c=n.forwardRef,h=void 0!==c&&c,d=n.enforceContext,f=void 0===d||d,p=function(t){return i.createElement(u,null,(function(n){var s;f&&(0,o.invariantIntlContext)(n);var a=((s={})[l]=n,s);return i.createElement(e,r.__assign({},t,a,{ref:h?t.forwardedRef:null}))}))};return p.displayName="injectIntl(".concat(function(e){return e.displayName||e.name||"Component"}(e),")"),p.WrappedComponent=e,h?(0,s.default)(i.forwardRef((function(e,t){return i.createElement(p,r.__assign({},e,{forwardedRef:t}))})),e):(0,s.default)(p,e)}},"./node_modules/react-intl/src/components/message.js":function(e,t,n){"use strict";var r=n("./node_modules/tslib/tslib.es6.mjs"),i=r.__importStar(n("./node_modules/react/index.js")),s=r.__importDefault(n("./node_modules/react-intl/src/components/useIntl.js")),o=n("./node_modules/react-intl/src/utils.js");function a(e){var t=(0,s.default)(),n=t.formatMessage,r=t.textComponent,o=void 0===r?i.Fragment:r,a=e.id,u=e.description,l=e.defaultMessage,c=e.values,h=e.children,d=e.tagName,f=void 0===d?o:d,p=n({id:a,description:u,defaultMessage:l},c,{ignoreTag:e.ignoreTag});return"function"==typeof h?h(Array.isArray(p)?p:[p]):f?i.createElement(f,null,i.Children.toArray(p)):i.createElement(i.Fragment,null,p)}a.displayName="FormattedMessage";var u=i.memo(a,(function(e,t){var n=e.values,i=r.__rest(e,["values"]),s=t.values,a=r.__rest(t,["values"]);return(0,o.shallowEqual)(s,n)&&(0,o.shallowEqual)(i,a)}));u.displayName="MemoizedFormattedMessage",t.A=u},"./node_modules/react-intl/src/components/useIntl.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("./node_modules/tslib/tslib.es6.mjs").__importStar(n("./node_modules/react/index.js")),i=n("./node_modules/react-intl/src/components/injectIntl.js"),s=n("./node_modules/react-intl/src/utils.js");t.default=function(){var e=r.useContext(i.Context);return(0,s.invariantIntlContext)(e),e}},"./node_modules/react-intl/src/utils.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shallowEqual=t.assignUniqueKeysToParts=t.DEFAULT_INTL_CONFIG=t.invariantIntlContext=void 0;var r=n("./node_modules/tslib/tslib.es6.mjs"),i=r.__importStar(n("./node_modules/react/index.js")),s=n("./node_modules/@formatjs/ecma402-abstract/lib/index.js"),o=n("./node_modules/@formatjs/intl/lib/index.js");t.invariantIntlContext=function(e){(0,s.invariant)(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")},t.DEFAULT_INTL_CONFIG=r.__assign(r.__assign({},o.DEFAULT_INTL_CONFIG),{textComponent:i.Fragment}),t.assignUniqueKeysToParts=function(e){return function(t){return e(i.Children.toArray(t))}},t.shallowEqual=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(var s=0;s<i;s++){var o=n[s];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0}},"./node_modules/react-is/cjs/react-is.production.min.js":function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,u=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,_=n?Symbol.for("react.fundamental"):60117,v=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case h:case s:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case l:case d:case g:case m:case u:return e;default:return t}}case i:return t}}}function E(e){return w(e)===h}t.AsyncMode=c,t.ConcurrentMode=h,t.ContextConsumer=l,t.ContextProvider=u,t.Element=r,t.ForwardRef=d,t.Fragment=s,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return E(e)||w(e)===c},t.isConcurrentMode=E,t.isContextConsumer=function(e){return w(e)===l},t.isContextProvider=function(e){return w(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===s},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===o},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===h||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===u||e.$$typeof===l||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===b||e.$$typeof===y)},t.typeOf=w},"./node_modules/react-is/index.js":function(e,t,n){"use strict";e.exports=n("./node_modules/react-is/cjs/react-is.production.min.js")},"./node_modules/react-router-dom/dist/index.js":function(e,t,n){"use strict";var r,i;n.d(t,{I9:function(){return f},N_:function(){return g}});var s=n("./node_modules/react/index.js"),o=n("./node_modules/react-dom/index.js"),a=n("./node_modules/react-router/dist/index.js"),u=n("./node_modules/@remix-run/router/dist/router.js");function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function c(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const h=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map;const d=(r||(r=n.t(s,2))).startTransition;(i||(i=n.t(o,2))).flushSync,(r||(r=n.t(s,2))).useId;function f(e){let{basename:t,children:n,future:r,window:i}=e,o=s.useRef();null==o.current&&(o.current=(0,u.TM)({window:i,v5Compat:!0}));let l=o.current,[c,h]=s.useState({action:l.action,location:l.location}),{v7_startTransition:f}=r||{},p=s.useCallback((e=>{f&&d?d((()=>h(e))):h(e)}),[h,f]);return s.useLayoutEffect((()=>l.listen(p)),[l,p]),s.createElement(a.Ix,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:l,future:r})}const p="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,m=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,g=s.forwardRef((function(e,t){let n,{onClick:r,relative:i,reloadDocument:o,replace:d,state:f,target:g,to:y,preventScrollReset:_,unstable_viewTransition:v}=e,b=c(e,h),{basename:w}=s.useContext(a.jb),E=!1;if("string"==typeof y&&m.test(y)&&(n=y,p))try{let e=new URL(window.location.href),t=y.startsWith("//")?new URL(e.protocol+y):new URL(y),n=(0,u.pb)(t.pathname,w);t.origin===e.origin&&null!=n?y=n+t.search+t.hash:E=!0}catch(e){}let S=(0,a.$P)(y,{relative:i}),T=function(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:l,unstable_viewTransition:c}=void 0===t?{}:t,h=(0,a.Zp)(),d=(0,a.zy)(),f=(0,a.x$)(e,{relative:l});return s.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:(0,u.AO)(d)===(0,u.AO)(f);h(e,{replace:n,state:i,preventScrollReset:o,relative:l,unstable_viewTransition:c})}}),[d,h,f,r,i,n,e,o,l,c])}(y,{replace:d,state:f,target:g,preventScrollReset:_,relative:i,unstable_viewTransition:v});return s.createElement("a",l({},b,{href:n||S,onClick:E||o?r:function(e){r&&r(e),e.defaultPrevented||T(e)},ref:t,target:g}))}));var y,_;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(y||(y={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(_||(_={}))},"./node_modules/react-router/dist/index.js":function(e,t,n){"use strict";var r;n.d(t,{$P:function(){return f},BV:function(){return L},C5:function(){return x},Ix:function(){return O},Zp:function(){return y},g:function(){return _},jb:function(){return l},qh:function(){return R},x$:function(){return v},zy:function(){return m}});var i=n("./node_modules/react/index.js"),s=n("./node_modules/@remix-run/router/dist/router.js");function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}const a=i.createContext(null);const u=i.createContext(null);const l=i.createContext(null);const c=i.createContext(null);const h=i.createContext({outlet:null,matches:[],isDataRoute:!1});const d=i.createContext(null);function f(e,t){let{relative:n}=void 0===t?{}:t;p()||(0,s.Oi)(!1);let{basename:r,navigator:o}=i.useContext(l),{hash:a,pathname:u,search:c}=v(e,{relative:n}),h=u;return"/"!==r&&(h="/"===u?r:(0,s.HS)([r,u])),o.createHref({pathname:h,search:c,hash:a})}function p(){return null!=i.useContext(c)}function m(){return p()||(0,s.Oi)(!1),i.useContext(c).location}function g(e){i.useContext(l).static||i.useLayoutEffect(e)}function y(){let{isDataRoute:e}=i.useContext(h);return e?function(){let{router:e}=A(I.UseNavigateStable),t=D(k.UseNavigateStable),n=i.useRef(!1);return g((()=>{n.current=!0})),i.useCallback((function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,o({fromRouteId:t},i)))}),[e,t])}():function(){p()||(0,s.Oi)(!1);let e=i.useContext(a),{basename:t,future:n,navigator:r}=i.useContext(l),{matches:o}=i.useContext(h),{pathname:u}=m(),c=JSON.stringify((0,s.yD)(o,n.v7_relativeSplatPath)),d=i.useRef(!1);return g((()=>{d.current=!0})),i.useCallback((function(n,i){if(void 0===i&&(i={}),!d.current)return;if("number"==typeof n)return void r.go(n);let o=(0,s.Gh)(n,JSON.parse(c),u,"path"===i.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:(0,s.HS)([t,o.pathname])),(i.replace?r.replace:r.push)(o,i.state,i)}),[t,r,c,u,e])}()}function _(){let{matches:e}=i.useContext(h),t=e[e.length-1];return t?t.params:{}}function v(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=i.useContext(l),{matches:o}=i.useContext(h),{pathname:a}=m(),u=JSON.stringify((0,s.yD)(o,r.v7_relativeSplatPath));return i.useMemo((()=>(0,s.Gh)(e,JSON.parse(u),a,"path"===n)),[e,u,a,n])}function b(e,t,n,r){p()||(0,s.Oi)(!1);let{navigator:a}=i.useContext(l),{matches:u}=i.useContext(h),d=u[u.length-1],f=d?d.params:{},g=(d&&d.pathname,d?d.pathnameBase:"/");d&&d.route;let y,_=m();if(t){var v;let e="string"==typeof t?(0,s.Rr)(t):t;"/"===g||(null==(v=e.pathname)?void 0:v.startsWith(g))||(0,s.Oi)(!1),y=e}else y=_;let b=y.pathname||"/",w=b;if("/"!==g){let e=g.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let E=(0,s.ue)(e,{pathname:w});let S=C(E&&E.map((e=>Object.assign({},e,{params:Object.assign({},f,e.params),pathname:(0,s.HS)([g,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?g:(0,s.HS)([g,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),u,n,r);return t&&S?i.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:s.rc.Pop}},S):S}function w(){let e=function(){var e;let t=i.useContext(d),n=N(k.UseRouteError),r=D(k.UseRouteError);if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=(0,s.pX)(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r};return i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,null)}const E=i.createElement(w,null);class S extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?i.createElement(h.Provider,{value:this.props.routeContext},i.createElement(d.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function T(e){let{routeContext:t,match:n,children:r}=e,s=i.useContext(a);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),i.createElement(h.Provider,{value:t},r)}function C(e,t,n,r){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===r&&(r=null),null==e){var a;if(null==(a=n)||!a.errors)return null;e=n.matches}let u=e,l=null==(o=n)?void 0:o.errors;if(null!=l){let e=u.findIndex((e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id])));e>=0||(0,s.Oi)(!1),u=u.slice(0,Math.min(u.length,e+1))}let c=!1,h=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<u.length;e++){let t=u[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(h=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){c=!0,u=h>=0?u.slice(0,h+1):[u[0]];break}}}return u.reduceRight(((e,r,s)=>{let o,a=!1,d=null,f=null;var p;n&&(o=l&&r.route.id?l[r.route.id]:void 0,d=r.route.errorElement||E,c&&(h<0&&0===s?(p="route-fallback",!1||P[p]||(P[p]=!0),a=!0,f=null):h===s&&(a=!0,f=r.route.hydrateFallbackElement||null)));let m=t.concat(u.slice(0,s+1)),g=()=>{let t;return t=o?d:a?f:r.route.Component?i.createElement(r.route.Component,null):r.route.element?r.route.element:e,i.createElement(T,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===s)?i.createElement(S,{location:n.location,revalidation:n.revalidation,component:d,error:o,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()}),null)}var I=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(I||{}),k=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(k||{});function A(e){let t=i.useContext(a);return t||(0,s.Oi)(!1),t}function N(e){let t=i.useContext(u);return t||(0,s.Oi)(!1),t}function D(e){let t=function(e){let t=i.useContext(h);return t||(0,s.Oi)(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||(0,s.Oi)(!1),n.route.id}const P={};(r||(r=n.t(i,2))).startTransition;function x(e){let{to:t,replace:n,state:r,relative:o}=e;p()||(0,s.Oi)(!1);let{future:a,static:u}=i.useContext(l),{matches:c}=i.useContext(h),{pathname:d}=m(),f=y(),g=(0,s.Gh)(t,(0,s.yD)(c,a.v7_relativeSplatPath),d,"path"===o),_=JSON.stringify(g);return i.useEffect((()=>f(JSON.parse(_),{replace:n,state:r,relative:o})),[f,_,o,n,r]),null}function R(e){(0,s.Oi)(!1)}function O(e){let{basename:t="/",children:n=null,location:r,navigationType:a=s.rc.Pop,navigator:u,static:h=!1,future:d}=e;p()&&(0,s.Oi)(!1);let f=t.replace(/^\/*/,"/"),m=i.useMemo((()=>({basename:f,navigator:u,static:h,future:o({v7_relativeSplatPath:!1},d)})),[f,d,u,h]);"string"==typeof r&&(r=(0,s.Rr)(r));let{pathname:g="/",search:y="",hash:_="",state:v=null,key:b="default"}=r,w=i.useMemo((()=>{let e=(0,s.pb)(g,f);return null==e?null:{location:{pathname:e,search:y,hash:_,state:v,key:b},navigationType:a}}),[f,g,y,_,v,b,a]);return null==w?null:i.createElement(l.Provider,{value:m},i.createElement(c.Provider,{children:n,value:w}))}function L(e){let{children:t,location:n}=e;return b(M(t),n)}new Promise((()=>{}));i.Component;function M(e,t){void 0===t&&(t=[]);let n=[];return i.Children.forEach(e,((e,r)=>{if(!i.isValidElement(e))return;let o=[...t,r];if(e.type===i.Fragment)return void n.push.apply(n,M(e.props.children,o));e.type!==R&&(0,s.Oi)(!1),e.props.index&&e.props.children&&(0,s.Oi)(!1);let a={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=M(e.props.children,o)),n.push(a)})),n}},"./node_modules/react/cjs/react.production.min.js":function(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function _(){}function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=y.prototype;var b=v.prototype=new _;b.constructor=v,m(b,y.prototype),b.isPureReactComponent=!0;var w=Array.isArray,E=Object.prototype.hasOwnProperty,S={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var i,s={},o=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)E.call(t,i)&&!T.hasOwnProperty(i)&&(s[i]=t[i]);var u=arguments.length-2;if(1===u)s.children=r;else if(1<u){for(var l=Array(u),c=0;c<u;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(i in u=e.defaultProps)void 0===s[i]&&(s[i]=u[i]);return{$$typeof:n,type:e,key:o,ref:a,props:s,_owner:S.current}}function I(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var k=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function N(e,t,i,s,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var u=!1;if(null===e)u=!0;else switch(a){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case n:case r:u=!0}}if(u)return o=o(u=e),e=""===s?"."+A(u,0):s,w(o)?(i="",null!=e&&(i=e.replace(k,"$&/")+"/"),N(o,t,i,"",(function(e){return e}))):null!=o&&(I(o)&&(o=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||u&&u.key===o.key?"":(""+o.key).replace(k,"$&/")+"/")+e)),t.push(o)),1;if(u=0,s=""===s?".":s+":",w(e))for(var l=0;l<e.length;l++){var c=s+A(a=e[l],l);u+=N(a,t,i,c,o)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),l=0;!(a=e.next()).done;)u+=N(a=a.value,t,i,c=s+A(a,l++),o);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function D(e,t,n){if(null==e)return e;var r=[],i=0;return N(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function P(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var x={current:null},R={transition:null},O={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:R,ReactCurrentOwner:S};function L(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:D,forEach:function(e,t,n){D(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return D(e,(function(){t++})),t},toArray:function(e){return D(e,(function(e){return e}))||[]},only:function(e){if(!I(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=o,t.PureComponent=v,t.StrictMode=s,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O,t.act=L,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=m({},e.props),s=e.key,o=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,a=S.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(l in t)E.call(t,l)&&!T.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==u?u[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){u=Array(l);for(var c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}return{$$typeof:n,type:e.type,key:s,ref:o,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=I,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},t.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=R.transition;R.transition={};try{e()}finally{R.transition=t}},t.unstable_act=L,t.useCallback=function(e,t){return x.current.useCallback(e,t)},t.useContext=function(e){return x.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return x.current.useDeferredValue(e)},t.useEffect=function(e,t){return x.current.useEffect(e,t)},t.useId=function(){return x.current.useId()},t.useImperativeHandle=function(e,t,n){return x.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return x.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return x.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return x.current.useMemo(e,t)},t.useReducer=function(e,t,n){return x.current.useReducer(e,t,n)},t.useRef=function(e){return x.current.useRef(e)},t.useState=function(e){return x.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return x.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return x.current.useTransition()},t.version="18.3.1"},"./node_modules/react/index.js":function(e,t,n){"use strict";e.exports=n("./node_modules/react/cjs/react.production.min.js")},"./node_modules/scheduler/cjs/scheduler.production.min.js":function(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<s(i,t)))break e;e[r]=t,e[n]=i,n=r}}function r(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,o=i>>>1;r<o;){var a=2*(r+1)-1,u=e[a],l=a+1,c=e[l];if(0>s(u,n))l<i&&0>s(c,u)?(e[r]=c,e[l]=n,r=l):(e[r]=u,e[a]=n,r=a);else{if(!(l<i&&0>s(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function s(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var l=[],c=[],h=1,d=null,f=3,p=!1,m=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,_="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var t=r(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,n(l,t)}t=r(c)}}function w(e){if(g=!1,b(e),!m)if(null!==r(l))m=!0,R(E);else{var t=r(c);null!==t&&O(w,t.startTime-e)}}function E(e,n){m=!1,g&&(g=!1,_(I),I=-1),p=!0;var s=f;try{for(b(n),d=r(l);null!==d&&(!(d.expirationTime>n)||e&&!N());){var o=d.callback;if("function"==typeof o){d.callback=null,f=d.priorityLevel;var a=o(d.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?d.callback=a:d===r(l)&&i(l),b(n)}else i(l);d=r(l)}if(null!==d)var u=!0;else{var h=r(c);null!==h&&O(w,h.startTime-n),u=!1}return u}finally{d=null,f=s,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,T=!1,C=null,I=-1,k=5,A=-1;function N(){return!(t.unstable_now()-A<k)}function D(){if(null!==C){var e=t.unstable_now();A=e;var n=!0;try{n=C(!0,e)}finally{n?S():(T=!1,C=null)}}else T=!1}if("function"==typeof v)S=function(){v(D)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,x=P.port2;P.port1.onmessage=D,S=function(){x.postMessage(null)}}else S=function(){y(D,0)};function R(e){C=e,T||(T=!0,S())}function O(e,n){I=y((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,R(E))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},t.unstable_scheduleCallback=function(e,i,s){var o=t.unstable_now();switch("object"==typeof s&&null!==s?s="number"==typeof(s=s.delay)&&0<s?o+s:o:s=o,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:h++,callback:i,priorityLevel:e,startTime:s,expirationTime:a=s+a,sortIndex:-1},s>o?(e.sortIndex=s,n(c,e),null===r(l)&&e===r(c)&&(g?(_(I),I=-1):g=!0,O(w,s-o))):(e.sortIndex=a,n(l,e),m||p||(m=!0,R(E))),e},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}},"./node_modules/scheduler/index.js":function(e,t,n){"use strict";e.exports=n("./node_modules/scheduler/cjs/scheduler.production.min.js")},"./node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js":function(e,t,n){"use strict";var r=n("./node_modules/react/index.js");var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useSyncExternalStore,o=r.useRef,a=r.useEffect,u=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,c){var h=o(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=u((function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==c&&d.hasValue){var t=d.value;if(c(t,e))return o=t}return o=e}if(t=o,i(s,e))return t;var n=r(e);return void 0!==c&&c(t,n)?t:(s=e,o=n)}var s,o,a=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,c]);var f=s(e,h[0],h[1]);return a((function(){d.hasValue=!0,d.value=f}),[f]),l(f),f}},"./node_modules/use-sync-external-store/with-selector.js":function(e,t,n){"use strict";e.exports=n("./node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.min.js")},"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js":function(e,t,n){var r=n("./node_modules/@babel/runtime/helpers/typeof.js").default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},s=Object.prototype,o=s.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,s=Object.create(i.prototype),o=new R(r||[]);return a(s,"_invoke",{value:N(e,n,o)}),s}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var m="suspendedStart",g="suspendedYield",y="executing",_="completed",v={};function b(){}function w(){}function E(){}var S={};d(S,l,(function(){return this}));var T=Object.getPrototypeOf,C=T&&T(T(O([])));C&&C!==s&&o.call(C,l)&&(S=C);var I=E.prototype=b.prototype=Object.create(S);function k(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,s,a,u){var l=p(e[i],e,s);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==r(h)&&o.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,u)}))}u(l.arg)}var i;a(this,"_invoke",{value:function(e,r){function s(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(s,s):s()}})}function N(e,n,r){var i=m;return function(s,o){if(i===y)throw Error("Generator is already running");if(i===_){if("throw"===s)throw o;return{value:t,done:!0}}for(r.method=s,r.arg=o;;){var a=r.delegate;if(a){var u=D(a,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===m)throw i=_,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=y;var l=p(e,n,r);if("normal"===l.type){if(i=r.done?_:g,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=_,r.method="throw",r.arg=l.arg)}}}function D(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var s=p(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,v;var o=s.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function O(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=E,a(I,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:w,configurable:!0}),w.displayName=d(E,h,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,d(e,h,"GeneratorFunction")),e.prototype=Object.create(I),e},n.awrap=function(e){return{__await:e}},k(A.prototype),d(A.prototype,c,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,s){void 0===s&&(s=Promise);var o=new A(f(e,t,r,i),s);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},k(I),d(I,h,"Generator"),d(I,l,(function(){return this})),d(I,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=O,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return a.type="throw",a.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),l=o.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/helpers/typeof.js":function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},"./node_modules/@babel/runtime/regenerator/index.js":function(e,t,n){var r=n("./node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{A:function(){return r}})},"./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js":function(e,t,n){"use strict";function r(e,t,n,r,i,s,o){try{var a=e[s](o),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,u,"next",e)}function u(e){r(o,i,s,a,u,"throw",e)}a(void 0)}))}}n.d(t,{A:function(){return i}})},"./node_modules/@babel/runtime/helpers/esm/classCallCheck.js":function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:function(){return r}})},"./node_modules/@babel/runtime/helpers/esm/createClass.js":function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n("./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(0,r.A)(i.key),i)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},"./node_modules/@babel/runtime/helpers/esm/defineProperty.js":function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n("./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");function i(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},"./node_modules/@babel/runtime/helpers/esm/extends.js":function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:function(){return r}})},"./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,{A:function(){return r}})},"./node_modules/@babel/runtime/helpers/esm/inherits.js":function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}n.d(t,{A:function(){return i}})},"./node_modules/@babel/runtime/helpers/esm/jsx.js":function(e,t,n){"use strict";var r;function i(e,t,n,i){r||(r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var s=e&&e.defaultProps,o=arguments.length-3;if(t||0===o||(t={children:void 0}),1===o)t.children=i;else if(o>1){for(var a=Array(o),u=0;u<o;u++)a[u]=arguments[u+3];t.children=a}if(t&&s)for(var l in s)void 0===t[l]&&(t[l]=s[l]);else t||(t=s||{});return{$$typeof:r,type:e,key:void 0===n?null:""+n,ref:null,props:t,_owner:null}}n.d(t,{A:function(){return i}})},"./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js":function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{A:function(){return r}})},"./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n("./node_modules/@babel/runtime/helpers/esm/typeof.js");function i(e,t){if(t&&("object"===(0,r.A)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}},"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js":function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,o,a=[],u=!0,l=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return a}}(e,t)||(0,r.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");var i=n("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");function s(e){return function(e){if(Array.isArray(e))return(0,r.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,i.A)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n("./node_modules/@babel/runtime/helpers/esm/typeof.js");function i(e){var t=function(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=(0,r.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},"./node_modules/@babel/runtime/helpers/esm/typeof.js":function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:function(){return r}})},"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":function(e,t,n){"use strict";n.d(t,{A:function(){return i}});var r=n("./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");function i(e,t){if(e){if("string"==typeof e)return(0,r.A)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,r.A)(e,t):void 0}}},"./node_modules/@firebase/app/dist/esm/index.esm2017.js":function(e,t,n){"use strict";n.d(t,{MF:function(){return le},j6:function(){return ie},xZ:function(){return se},om:function(){return re},NM:function(){return de},Sx:function(){return he},Wp:function(){return ce},KO:function(){return fe}});var r=n("./node_modules/@firebase/component/dist/esm/index.esm2017.js"),i=n("./node_modules/@firebase/logger/dist/esm/index.esm2017.js"),s=n("./node_modules/@firebase/util/dist/index.esm2017.js");const o=(e,t)=>t.some((t=>e instanceof t));let a,u;const l=new WeakMap,c=new WeakMap,h=new WeakMap,d=new WeakMap,f=new WeakMap;let p={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return c.get(e);if("objectStoreNames"===t)return e.objectStoreNames||h.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return y(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function m(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(u||(u=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(_(this),t),y(l.get(this))}:function(...t){return y(e.apply(_(this),t))}:function(t,...n){const r=e.call(_(this),t,...n);return h.set(r,t.sort?t.sort():[t]),y(r)}}function g(e){return"function"==typeof e?m(e):(e instanceof IDBTransaction&&function(e){if(c.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)}));c.set(e,t)}(e),o(e,a||(a=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,p):e)}function y(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(y(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&l.set(t,e)})).catch((()=>{})),f.set(t,e),t}(e);if(d.has(e))return d.get(e);const t=g(e);return t!==e&&(d.set(e,t),f.set(t,e)),t}const _=e=>f.get(e);const v=["get","getKey","getAll","getAllKeys","count"],b=["put","add","delete","clear"],w=new Map;function E(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w.get(t))return w.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=b.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!v.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,i?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]};return w.set(t,s),s}p=(e=>({...e,get:(t,n,r)=>E(t,n)||e.get(t,n,r),has:(t,n)=>!!E(t,n)||e.has(t,n)}))(p);class S{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const T="@firebase/app",C="0.10.2",I=new i.Vy("@firebase/app"),k="@firebase/app-compat",A="@firebase/analytics-compat",N="@firebase/analytics",D="@firebase/app-check-compat",P="@firebase/app-check",x="@firebase/auth",R="@firebase/auth-compat",O="@firebase/database",L="@firebase/database-compat",M="@firebase/functions",F="@firebase/functions-compat",j="@firebase/installations",U="@firebase/installations-compat",B="@firebase/messaging",V="@firebase/messaging-compat",H="@firebase/performance",z="@firebase/performance-compat",q="@firebase/remote-config",G="@firebase/remote-config-compat",$="@firebase/storage",K="@firebase/storage-compat",W="@firebase/firestore",Q="@firebase/firestore-compat",Y="firebase",X="[DEFAULT]",J={[T]:"fire-core",[k]:"fire-core-compat",[N]:"fire-analytics",[A]:"fire-analytics-compat",[P]:"fire-app-check",[D]:"fire-app-check-compat",[x]:"fire-auth",[R]:"fire-auth-compat",[O]:"fire-rtdb",[L]:"fire-rtdb-compat",[M]:"fire-fn",[F]:"fire-fn-compat",[j]:"fire-iid",[U]:"fire-iid-compat",[B]:"fire-fcm",[V]:"fire-fcm-compat",[H]:"fire-perf",[z]:"fire-perf-compat",[q]:"fire-rc",[G]:"fire-rc-compat",[$]:"fire-gcs",[K]:"fire-gcs-compat",[W]:"fire-fst",[Q]:"fire-fst-compat","fire-js":"fire-js",[Y]:"fire-js-all"},Z=new Map,ee=new Map,te=new Map;function ne(e,t){try{e.container.addComponent(t)}catch(n){I.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function re(e){const t=e.name;if(te.has(t))return I.debug(`There were multiple attempts to register component ${t}.`),!1;te.set(t,e);for(const t of Z.values())ne(t,e);for(const t of ee.values())ne(t,e);return!0}function ie(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function se(e){return void 0!==e.settings}const oe={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},ae=new s.FA("app","Firebase",oe);class ue{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.uA("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ae.create("app-deleted",{appName:this._name})}}const le="10.11.1";function ce(e,t={}){let n=e;if("object"!=typeof t){t={name:t}}const i=Object.assign({name:X,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!=typeof o||!o)throw ae.create("bad-app-name",{appName:String(o)});if(n||(n=(0,s.T9)()),!n)throw ae.create("no-options");const a=Z.get(o);if(a){if((0,s.bD)(n,a.options)&&(0,s.bD)(i,a.config))return a;throw ae.create("duplicate-app",{appName:o})}const u=new r.h1(o);for(const e of te.values())u.addComponent(e);const l=new ue(n,i,u);return Z.set(o,l),l}function he(e=X){const t=Z.get(e);if(!t&&e===X&&(0,s.T9)())return ce();if(!t)throw ae.create("no-app",{appName:e});return t}async function de(e){let t=!1;const n=e.name;if(Z.has(n))t=!0,Z.delete(n);else if(ee.has(n)){e.decRefCount()<=0&&(ee.delete(n),t=!0)}t&&(await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function fe(e,t,n){var i;let s=null!==(i=J[e])&&void 0!==i?i:e;n&&(s+=`-${n}`);const o=s.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${s}" with version "${t}":`];return o&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void I.warn(e.join(" "))}re(new r.uA(`${s}-version`,(()=>({library:s,version:t})),"VERSION"))}const pe="firebase-heartbeat-database",me=1,ge="firebase-heartbeat-store";let ye=null;function _e(){return ye||(ye=function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=y(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(y(o.result),e.oldVersion,e.newVersion,y(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}(pe,me,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(ge)}catch(e){console.warn(e)}}}).catch((e=>{throw ae.create("idb-open",{originalErrorMessage:e.message})}))),ye}async function ve(e,t){try{const n=(await _e()).transaction(ge,"readwrite"),r=n.objectStore(ge);await r.put(t,be(e)),await n.done}catch(e){if(e instanceof s.g)I.warn(e.message);else{const t=ae.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});I.warn(t.message)}}}function be(e){return`${e.name}!${e.options.appId}`}class we{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Se(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){var e,t;const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=Ee();if((null!=(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||(this._heartbeatsCache=await this._heartbeatsCachePromise,null!=(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))&&this._heartbeatsCache.lastSentHeartbeatDate!==r&&!this._heartbeatsCache.heartbeats.some((e=>e.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=Ee(),{heartbeatsToSend:n,unsentEntries:r}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),Te(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Te(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),i=(0,s.Uj)(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function Ee(){return(new Date).toISOString().substring(0,10)}class Se{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,s.zW)()&&(0,s.eX)().then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await _e()).transaction(ge),n=await t.objectStore(ge).get(be(e));return await t.done,n}catch(e){if(e instanceof s.g)I.warn(e.message);else{const t=ae.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});I.warn(t.message)}}}(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ve(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ve(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function Te(e){return(0,s.Uj)(JSON.stringify({version:2,heartbeats:e})).length}var Ce;Ce="",re(new r.uA("platform-logger",(e=>new S(e)),"PRIVATE")),re(new r.uA("heartbeat",(e=>new we(e)),"PRIVATE")),fe(T,C,Ce),fe(T,C,"esm2017"),fe("fire-js","")},"./node_modules/@firebase/component/dist/esm/index.esm2017.js":function(e,t,n){"use strict";n.d(t,{h1:function(){return a},uA:function(){return i}});var r=n("./node_modules/@firebase/util/dist/index.esm2017.js");class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const s="[DEFAULT]";class o{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new r.cY;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:s})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=s){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e=s){return this.instances.has(e)}getOptions(e=s){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===s?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e=s){return this.component?this.component.multipleInstances?e:s:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class a{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new o(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},"./node_modules/@firebase/logger/dist/esm/index.esm2017.js":function(e,t,n){"use strict";n.d(t,{$b:function(){return i},Vy:function(){return l}});const r=[];var i;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(i||(i={}));const s={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,a={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},u=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=a[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}]  ${e.name}:`,...n)};class l{constructor(e){this.name=e,this._logLevel=o,this._logHandler=u,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?s[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}},"./node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs":function(e,t,n){"use strict";n.d(t,{U1:function(){return ve},Z0:function(){return Ie}});var r=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),s=Symbol.for("immer-state");function o(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var a=Object.getPrototypeOf;function u(e){return!!e&&!!e[s]}function l(e){return!!e&&(h(e)||Array.isArray(e)||!!e[i]||!!e.constructor?.[i]||g(e)||y(e))}var c=Object.prototype.constructor.toString();function h(e){if(!e||"object"!=typeof e)return!1;const t=a(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===c}function d(e,t){0===f(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function f(e){const t=e[s];return t?t.type_:Array.isArray(e)?1:g(e)?2:y(e)?3:0}function p(e,t){return 2===f(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m(e,t,n){const r=f(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function g(e){return e instanceof Map}function y(e){return e instanceof Set}function _(e){return e.copy_||e.base_}function v(e,t){if(g(e))return new Map(e);if(y(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=h(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[s];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],s=t[i];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(a(e),t)}{const t=a(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function b(e,t=!1){return E(e)||u(e)||!l(e)||(f(e)>1&&(e.set=e.add=e.clear=e.delete=w),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>b(t,!0)))),e}function w(){o(2)}function E(e){return Object.isFrozen(e)}var S,T={};function C(e){const t=T[e];return t||o(0),t}function I(){return S}function k(e,t){t&&(C("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function A(e){N(e),e.drafts_.forEach(P),e.drafts_=null}function N(e){e===S&&(S=e.parent_)}function D(e){return S={drafts_:[],parent_:S,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function P(e){const t=e[s];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function x(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[s].modified_&&(A(t),o(4)),l(e)&&(e=R(t,e),t.parent_||L(t,e)),t.patches_&&C("Patches").generateReplacementPatches_(n[s].base_,e,t.patches_,t.inversePatches_)):e=R(t,n,[]),A(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==r?e:void 0}function R(e,t,n){if(E(t))return t;const r=t[s];if(!r)return d(t,((i,s)=>O(e,r,t,i,s,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return L(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let i=t,s=!1;3===r.type_&&(i=new Set(t),t.clear(),s=!0),d(i,((i,o)=>O(e,r,t,i,o,n,s))),L(e,t,!1),n&&e.patches_&&C("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function O(e,t,n,r,i,s,o){if(u(i)){const o=R(e,i,s&&t&&3!==t.type_&&!p(t.assigned_,r)?s.concat(r):void 0);if(m(n,r,o),!u(o))return;e.canAutoFreeze_=!1}else o&&n.add(i);if(l(i)&&!E(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;R(e,i),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||L(e,i)}}function L(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&b(t,n)}var M={get(e,t){if(t===s)return e;const n=_(e);if(!p(n,t))return function(e,t,n){const r=U(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!l(r)?r:r===j(e.base_,t)?(V(e),e.copy_[t]=H(r,e)):r},has(e,t){return t in _(e)},ownKeys(e){return Reflect.ownKeys(_(e))},set(e,t,n){const r=U(_(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=j(_(e),t),a=r?.[s];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((i=n)===(o=r)?0!==i||1/i==1/o:i!=i&&o!=o)&&(void 0!==n||p(e.base_,t)))return!0;V(e),B(e)}var i,o;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return void 0!==j(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,V(e),B(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=_(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){o(11)},getPrototypeOf(e){return a(e.base_)},setPrototypeOf(){o(12)}},F={};function j(e,t){const n=e[s];return(n?_(n):e)[t]}function U(e,t){if(!(t in e))return;let n=a(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=a(n)}}function B(e){e.modified_||(e.modified_=!0,e.parent_&&B(e.parent_))}function V(e){e.copy_||(e.copy_=v(e.base_,e.scope_.immer_.useStrictShallowCopy_))}d(M,((e,t)=>{F[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),F.deleteProperty=function(e,t){return F.set.call(this,e,t,void 0)},F.set=function(e,t,n){return M.set.call(this,e[0],t,n,e[0])};function H(e,t){const n=g(e)?C("MapSet").proxyMap_(e,t):y(e)?C("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:I(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,s=M;n&&(i=[r],s=F);const{revoke:o,proxy:a}=Proxy.revocable(i,s);return r.draft_=a,r.revoke_=o,a}(e,t);return(t?t.scope_:I()).drafts_.push(n),n}function z(e){return u(e)||o(10),q(e)}function q(e){if(!l(e)||E(e))return e;const t=e[s];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=v(e,t.scope_.immer_.useStrictShallowCopy_)}else n=v(e,!0);return d(n,((e,t)=>{m(n,e,q(t))})),t&&(t.finalized_=!1),n}var G=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,(e=>t.call(this,e,...i)))}}let i;if("function"!=typeof t&&o(6),void 0!==n&&"function"!=typeof n&&o(7),l(e)){const r=D(this),s=H(e,void 0);let o=!0;try{i=t(s),o=!1}finally{o?A(r):N(r)}return k(r,n),x(i,r)}if(!e||"object"!=typeof e){if(i=t(e),void 0===i&&(i=e),i===r&&(i=void 0),this.autoFreeze_&&b(i,!0),n){const t=[],r=[];C("Patches").generateReplacementPatches_(e,i,t,r),n(t,r)}return i}o(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){l(e)||o(8),u(e)&&(e=z(e));const t=D(this),n=H(e,void 0);return n[s].isManual_=!0,N(t),n}finishDraft(e,t){const n=e&&e[s];n&&n.isManual_||o(9);const{scope_:r}=n;return k(r,t),x(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=C("Patches").applyPatches_;return u(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},$=G.produce;G.produceWithPatches.bind(G),G.setAutoFreeze.bind(G),G.setUseStrictShallowCopy.bind(G),G.applyPatches.bind(G),G.createDraft.bind(G),G.finishDraft.bind(G);function K(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}var W=e=>Array.isArray(e)?e:[e];function Q(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}Symbol(),Object.getPrototypeOf({});var Y="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},X=0,J=1;function Z(){return{s:X,v:void 0,o:null,p:null}}function ee(e,t={}){let n=Z();const{resultEqualityCheck:r}=t;let i,s=0;function o(){let t=n;const{length:o}=arguments;for(let e=0,n=o;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=Z(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=Z(),e.set(n,t)):t=r}}const a=t;let u;if(t.s===J?u=t.v:(u=e.apply(null,arguments),s++),a.s=J,r){const e=i?.deref?.()??i;null!=e&&r(e,u)&&(u=e,0!==s&&s--);i="object"==typeof u&&null!==u||"function"==typeof u?new Y(u):u}return a.v=u,u}return o.clearCache=()=>{n=Z(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function te(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,i=0,s={},o=e.pop();"object"==typeof o&&(s=o,o=e.pop()),K(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);const a={...n,...s},{memoize:u,memoizeOptions:l=[],argsMemoize:c=ee,argsMemoizeOptions:h=[],devModeChecks:d={}}=a,f=W(l),p=W(h),m=Q(e),g=u((function(){return r++,o.apply(null,arguments)}),...f);const y=c((function(){i++;const e=function(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}(m,arguments);return t=g.apply(null,e),t}),...p);return Object.assign(y,{resultFunc:o,memoizedResultFunc:g,dependencies:m,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:u,argsMemoize:c})};return Object.assign(r,{withTypes:()=>r}),r}var ne=te(ee),re=Object.assign(((e,t=ne)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>re}),ie=n("./node_modules/redux/dist/redux.mjs");function se(e){return({dispatch:t,getState:n})=>r=>i=>"function"==typeof i?i(t,n,e):r(i)}var oe=se(),ae=se,ue=(((...e)=>{const t=te(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(u(e)?z(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(ee),"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ie.Zz:ie.Zz.apply(null,arguments)});"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function le(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(Le(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>(0,ie.ve)(t)&&t.type===e,n}var ce=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function he(e){return l(e)?$(e,(()=>{})):e}function de(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(Le(10));const r=n.insert(t,e);return e.set(t,r),r}var fe=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:i=!0}=e??{};let s=new ce;return t&&("boolean"==typeof t?s.push(oe):s.push(ae(t.extraArgument))),s},pe="RTK_autoBatch",me=e=>t=>{setTimeout(t,e)},ge="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:me(10),ye=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new ce(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,o=!1;const a=new Set,u="tick"===e.type?queueMicrotask:"raf"===e.type?ge:"callback"===e.type?e.queueNotification:me(e.timeout),l=()=>{o=!1,s&&(s=!1,a.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>i&&e()));return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return i=!e?.meta?.[pe],s=!i,s&&(o||(o=!0,u(l))),r.dispatch(e)}finally{i=!0}}})})("object"==typeof n?n:void 0)),r},_e=!0;function ve(e){const t=fe(),{reducer:n,middleware:r,devTools:i=!0,preloadedState:s,enhancers:o}=e||{};let a,u;if("function"==typeof n)a=n;else{if(!(0,ie.Qd)(n))throw new Error(Le(1));a=(0,ie.HY)(n)}if(!_e&&r&&"function"!=typeof r)throw new Error(Le(2));if("function"==typeof r){if(u=r(t),!_e&&!Array.isArray(u))throw new Error(Le(3))}else u=t();if(!_e&&u.some((e=>"function"!=typeof e)))throw new Error(Le(4));let l=ie.Zz;i&&(l=ue({trace:!_e,..."object"==typeof i&&i}));const c=(0,ie.Tw)(...u),h=ye(c);if(!_e&&o&&"function"!=typeof o)throw new Error(Le(5));let d="function"==typeof o?o(h):h();if(!_e&&!Array.isArray(d))throw new Error(Le(6));if(!_e&&d.some((e=>"function"!=typeof e)))throw new Error(Le(7));_e||!u.length||d.includes(c)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const f=l(...d);return(0,ie.y$)(a,s,f)}function be(e){const t={},n=[];let r;const i={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(Le(28));if(r in t)throw new Error(Le(29));return t[r]=n,i},addMatcher(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase(e){return r=e,i}};return e(i),[t,n,r]}var we=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};var Ee=Symbol.for("rtk-slice-createasyncthunk");function Se(e,t){return`${e}/${t}`}function Te({creators:e}={}){const t=e?.asyncThunk?.[Ee];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(Le(11));const i=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):e.reducers)||{},s=Object.keys(i),o={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(Le(12));if(n in o.sliceCaseReducersByType)throw new Error(Le(13));return o.sliceCaseReducersByType[n]=t,a},addMatcher(e,t){return o.sliceMatchers.push({matcher:e,reducer:t}),a},exposeAction(e,t){return o.actionCreators[e]=t,a},exposeCaseReducer(e,t){return o.sliceCaseReducersByName[e]=t,a}};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?be(e.extraReducers):[e.extraReducers],i={...t,...o.sliceCaseReducersByType};return function(e,t){let n,[r,i,s]=be(t);if("function"==typeof e)n=()=>he(e());else{const t=he(e);n=()=>t}function o(e=n(),t){let o=[r[t.type],...i.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===o.filter((e=>!!e)).length&&(o=[s]),o.reduce(((e,n)=>{if(n){if(u(e)){const r=n(e,t);return void 0===r?e:r}if(l(e))return $(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(Le(9))}return r}}return e}),e)}return o.getInitialState=n,o}(e.initialState,(e=>{for(let t in i)e.addCase(t,i[t]);for(let t of o.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}))}s.forEach((r=>{const s=i[r],o={reducerName:r,type:Se(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(s)?function({type:e,reducerName:t,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(Le(17));s=r.reducer,o=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?le(e,o):le(e))}(o,s,a):function({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Le(18));const{payloadCreator:s,fulfilled:o,pending:a,rejected:u,settled:l,options:c}=n,h=i(e,s,c);r.exposeAction(t,h),o&&r.addCase(h.fulfilled,o);a&&r.addCase(h.pending,a);u&&r.addCase(h.rejected,u);l&&r.addMatcher(h.settled,l);r.exposeCaseReducer(t,{fulfilled:o||ke,pending:a||ke,rejected:u||ke,settled:l||ke})}(o,s,a,t)}));const h=e=>e,d=new Map;let f;function p(e,t){return f||(f=c()),f(e,t)}function m(){return f||(f=c()),f.getInitialState()}function g(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=m()),r}function i(t=h){const r=de(d,n,{insert:()=>new WeakMap});return de(r,t,{insert:()=>{const r={};for(const[i,s]of Object.entries(e.selectors??{}))r[i]=Ce(s,t,m,n);return r}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(r)},selectSlice:r}}const y={name:n,reducer:p,actions:o.actionCreators,caseReducers:o.sliceCaseReducersByName,getInitialState:m,...g(r),injectInto(e,{reducerPath:t,...n}={}){const i=t??r;return e.inject({reducerPath:i,reducer:p},n),{...y,...g(i,!0)}}};return y}}function Ce(e,t,n,r){function i(i,...s){let o=t(i);return void 0===o&&r&&(o=n()),e(o,...s)}return i.unwrapped=e,i}var Ie=Te();function ke(){}var Ae=(e,t)=>{if("function"!=typeof e)throw new Error(Le(32))};var{assign:Ne}=Object,De="listenerMiddleware",Pe=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:s}=e;if(t)i=le(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Le(21));return Ae(s),{predicate:i,type:t,effect:s}},xe=Object.assign((e=>{const{type:t,predicate:n,effect:r}=Pe(e);return{id:we(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Le(22))}}}),{withTypes:()=>xe}),Re=Object.assign(le(`${De}/add`),{withTypes:()=>Re}),Oe=(le(`${De}/removeAll`),Object.assign(le(`${De}/remove`),{withTypes:()=>Oe}));Symbol.for("rtk-state-proxy-original");function Le(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}},"./node_modules/firebase/app/dist/esm/index.esm.js":function(e,t,n){"use strict";n.d(t,{NM:function(){return r.NM},Wp:function(){return r.Wp}});var r=n("./node_modules/@firebase/app/dist/esm/index.esm2017.js");(0,r.KO)("firebase","10.11.1","app")},"./node_modules/firebase/auth/dist/esm/index.esm.js":function(e,t,n){"use strict";n.d(t,{xI:function(){return bn},zK:function(){return Qe}});var r=n("./node_modules/@firebase/app/dist/esm/index.esm2017.js"),i=n("./node_modules/@firebase/util/dist/index.esm2017.js"),s=n("./node_modules/@firebase/logger/dist/esm/index.esm2017.js"),o=n("./node_modules/tslib/tslib.es6.mjs"),a=n("./node_modules/@firebase/component/dist/esm/index.esm2017.js");function u(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const l=u,c=new i.FA("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),h=new s.Vy("@firebase/auth");function d(e,...t){h.logLevel<=s.$b.ERROR&&h.error(`Auth (${r.MF}): ${e}`,...t)}function f(e,...t){throw y(e,...t)}function p(e,...t){return y(e,...t)}function m(e,t,n){const r=Object.assign(Object.assign({},l()),{[t]:n});return new i.FA("auth","Firebase",r).create(t,{appName:e.name})}function g(e){return m(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function y(e,...t){if("string"!=typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return c.create(e,...t)}function _(e,t,...n){if(!e)throw y(t,...n)}function v(e){const t="INTERNAL ASSERTION FAILED: "+e;throw d(t),new Error(t)}function b(e,t){e||v(t)}function w(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function E(){return"http:"===S()||"https:"===S()}function S(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class T{constructor(e,t){this.shortDelay=e,this.longDelay=t,b(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,i.jZ)()||(0,i.lV)()}get(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(E()||(0,i.sr)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function C(e,t){b(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class I{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void v("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void v("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void v("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const k={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},A=new T(3e4,6e4);function N(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function D(e,t,n,r,s={}){return P(e,s,(async()=>{let s={},o={};r&&("GET"===t?o=r:s={body:JSON.stringify(r)});const a=(0,i.Am)(Object.assign({key:e.config.apiKey},o)).slice(1),u=await e._getAdditionalHeaders();return u["Content-Type"]="application/json",e.languageCode&&(u["X-Firebase-Locale"]=e.languageCode),I.fetch()(R(e,e.config.apiHost,n,a),Object.assign({method:t,headers:u,referrerPolicy:"no-referrer"},s))}))}async function P(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},k),t);try{const t=new L(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw M(e,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const t=i.ok?s.errorMessage:s.error.message,[n,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw M(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw M(e,"email-already-in-use",s);if("USER_DISABLED"===n)throw M(e,"user-disabled",s);const a=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw m(e,a,o);f(e,a)}}catch(t){if(t instanceof i.g)throw t;f(e,"network-request-failed",{message:String(t)})}}async function x(e,t,n,r,i={}){const s=await D(e,t,n,r,i);return"mfaPendingCredential"in s&&f(e,"multi-factor-auth-required",{_serverResponse:s}),s}function R(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?C(e.config,i):`${e.config.apiScheme}://${i}`}function O(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class L{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(p(this.auth,"network-request-failed"))),A.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function M(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=p(e,t,r);return i.customData._tokenResponse=n,i}function F(e){return void 0!==e&&void 0!==e.enterprise}class j{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return O(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}}async function U(e,t){return D(e,"GET","/v2/recaptchaConfig",N(e,t))}async function B(e,t){return D(e,"POST","/v1/accounts:lookup",t)}function V(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function H(e){return 1e3*Number(e)}function z(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return d("JWT malformed, contained fewer than 3 sections"),null;try{const e=(0,i.u)(n);return e?JSON.parse(e):(d("Failed to decode base64 JWT payload"),null)}catch(e){return d("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}function q(e){const t=z(e);return _(t,"internal-error"),_(void 0!==t.exp,"internal-error"),_(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function G(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof i.g&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class ${constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout((async()=>{await this.iteration()}),t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null==e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}class K{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=V(this.lastLoginAt),this.creationTime=V(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function W(e){var t;const n=e.auth,r=await e.getIdToken(),i=await G(e,B(n,{idToken:r}));_(null==i?void 0:i.users.length,n,"internal-error");const s=i.users[0];e._notifyReloadListener(s);const o=(null===(t=s.providerUserInfo)||void 0===t?void 0:t.length)?Q(s.providerUserInfo):[],a=(u=e.providerData,l=o,[...u.filter((e=>!l.some((t=>t.providerId===e.providerId)))),...l]);var u,l;const c=e.isAnonymous,h=!(e.email&&s.passwordHash||(null==a?void 0:a.length)),d=!!c&&h,f={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new K(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(e,f)}function Q(e){return e.map((e=>{var{providerId:t}=e,n=(0,o.__rest)(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}}))}class Y{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){_(e.idToken,"internal-error"),_(void 0!==e.idToken,"internal-error"),_(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):q(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){_(0!==e.length,"internal-error");const t=q(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return t||!this.accessToken||this.isExpired?(_(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:s}=await async function(e,t){const n=await P(e,{},(async()=>{const n=(0,i.Am)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:s}=e.config,o=R(e,r,"/v1/token",`key=${s}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",I.fetch()(o,{method:"POST",headers:a,body:n})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(s))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,s=new Y;return n&&(_("string"==typeof n,"internal-error",{appName:e}),s.refreshToken=n),r&&(_("string"==typeof r,"internal-error",{appName:e}),s.accessToken=r),i&&(_("number"==typeof i,"internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Y,this.toJSON())}_performRefresh(){return v("not implemented")}}function X(e,t){_("string"==typeof e||void 0===e,"internal-error",{appName:t})}class J{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=(0,o.__rest)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new $(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new K(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await G(this,this.stsTokenManager.getToken(this.auth,e));return _(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=(0,i.Ku)(e),r=await n.getIdToken(t),s=z(r);_(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o="object"==typeof s.firebase?s.firebase:void 0,a=null==o?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:V(H(s.auth_time)),issuedAtTime:V(H(s.iat)),expirationTime:V(H(s.exp)),signInProvider:a||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=(0,i.Ku)(e);await W(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(_(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((e=>Object.assign({},e))),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new J(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){_(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await W(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,r.xZ)(this.auth.app))return Promise.reject(g(this.auth));const e=await this.getIdToken();return await G(this,async function(e,t){return D(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((e=>Object.assign({},e))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,s,o,a,u,l;const c=null!==(n=t.displayName)&&void 0!==n?n:void 0,h=null!==(r=t.email)&&void 0!==r?r:void 0,d=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,f=null!==(s=t.photoURL)&&void 0!==s?s:void 0,p=null!==(o=t.tenantId)&&void 0!==o?o:void 0,m=null!==(a=t._redirectEventId)&&void 0!==a?a:void 0,g=null!==(u=t.createdAt)&&void 0!==u?u:void 0,y=null!==(l=t.lastLoginAt)&&void 0!==l?l:void 0,{uid:v,emailVerified:b,isAnonymous:w,providerData:E,stsTokenManager:S}=t;_(v&&S,e,"internal-error");const T=Y.fromJSON(this.name,S);_("string"==typeof v,e,"internal-error"),X(c,e.name),X(h,e.name),_("boolean"==typeof b,e,"internal-error"),_("boolean"==typeof w,e,"internal-error"),X(d,e.name),X(f,e.name),X(p,e.name),X(m,e.name),X(g,e.name),X(y,e.name);const C=new J({uid:v,auth:e,email:h,emailVerified:b,displayName:c,isAnonymous:w,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:T,createdAt:g,lastLoginAt:y});return E&&Array.isArray(E)&&(C.providerData=E.map((e=>Object.assign({},e)))),m&&(C._redirectEventId=m),C}static async _fromIdTokenResponse(e,t,n=!1){const r=new Y;r.updateFromServerResponse(t);const i=new J({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await W(i),i}static async _fromGetAccountInfoResponse(e,t,n){const r=t.users[0];_(void 0!==r.localId,"internal-error");const i=void 0!==r.providerUserInfo?Q(r.providerUserInfo):[],s=!(r.email&&r.passwordHash||(null==i?void 0:i.length)),o=new Y;o.updateFromIdToken(n);const a=new J({uid:r.localId,auth:e,stsTokenManager:o,isAnonymous:s}),u={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:i,metadata:new K(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash||(null==i?void 0:i.length))};return Object.assign(a,u),a}}const Z=new Map;function ee(e){b(e instanceof Function,"Expected a class definition");let t=Z.get(e);return t?(b(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Z.set(e,t),t)}class te{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}te.type="NONE";const ne=te;function re(e,t,n){return`firebase:${e}:${t}:${n}`}class ie{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=re(this.userKey,r.apiKey,i),this.fullPersistenceKey=re("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?J._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new ie(ee(ne),e,n);const r=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let i=r[0]||ee(ne);const s=re(n,e.config.apiKey,e.name);let o=null;for(const n of t)try{const t=await n._get(s);if(t){const r=J._fromJSON(e,t);n!==i&&(o=r),i=n;break}}catch(e){}const a=r.filter((e=>e._shouldAllowMigration));return i._shouldAllowMigration&&a.length?(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(t.map((async e=>{if(e!==i)try{await e._remove(s)}catch(e){}}))),new ie(i,e,n)):new ie(i,e,n)}}function se(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(le(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(oe(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(he(t))return"Blackberry";if(de(t))return"Webos";if(ae(t))return"Safari";if((t.includes("chrome/")||ue(t))&&!t.includes("edge/"))return"Chrome";if(ce(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function oe(e=(0,i.ZQ)()){return/firefox\//i.test(e)}function ae(e=(0,i.ZQ)()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function ue(e=(0,i.ZQ)()){return/crios\//i.test(e)}function le(e=(0,i.ZQ)()){return/iemobile/i.test(e)}function ce(e=(0,i.ZQ)()){return/android/i.test(e)}function he(e=(0,i.ZQ)()){return/blackberry/i.test(e)}function de(e=(0,i.ZQ)()){return/webos/i.test(e)}function fe(e=(0,i.ZQ)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function pe(e=(0,i.ZQ)()){return fe(e)||ce(e)||de(e)||he(e)||/windows phone/i.test(e)||le(e)}function me(e,t=[]){let n;switch(e){case"Browser":n=se((0,i.ZQ)());break;case"Worker":n=`${se((0,i.ZQ)())}-${e}`;break;default:n=e}const s=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${r.MF}/${s}`}class ge{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise(((n,r)=>{try{n(e(t))}catch(e){r(e)}}));n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}class ye{constructor(e){var t,n,r,i;const s=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=s.minPasswordLength)&&void 0!==t?t:6,s.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=s.maxPasswordLength),void 0!==s.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=s.containsLowercaseCharacter),void 0!==s.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=s.containsUppercaseCharacter),void 0!==s.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=s.containsNumericCharacter),void 0!==s.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=s.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(i=e.forceUpgradeOnSignin)&&void 0!==i&&i,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,i,s,o;const a={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,a),this.validatePasswordCharacterOptions(e,a),a.isValid&&(a.isValid=null===(t=a.meetsMinPasswordLength)||void 0===t||t),a.isValid&&(a.isValid=null===(n=a.meetsMaxPasswordLength)||void 0===n||n),a.isValid&&(a.isValid=null===(r=a.containsLowercaseLetter)||void 0===r||r),a.isValid&&(a.isValid=null===(i=a.containsUppercaseLetter)||void 0===i||i),a.isValid&&(a.isValid=null===(s=a.containsNumericCharacter)||void 0===s||s),a.isValid&&(a.isValid=null===(o=a.containsNonAlphanumericCharacter)||void 0===o||o),a}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class _e{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new be(this),this.idTokenSubscription=new be(this),this.beforeStateQueue=new ge(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=c,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ee(t)),this._initializationPromise=this.queue((async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await ie.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await B(this,{idToken:e}),n=await J._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(e){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",e),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if((0,r.xZ)(this.app)){const e=this.app.settings.authIdToken;return e?new Promise((t=>{setTimeout((()=>this.initializeCurrentUserFromIdToken(e).then(t,t)))})):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let i=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,r=null==i?void 0:i._redirectEventId,o=await this.tryRedirectSignIn(e);n&&n!==r||!(null==o?void 0:o.user)||(i=o.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(e){i=n,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(e)))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return _(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await W(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if((0,r.xZ)(this.app))return Promise.reject(g(this));const t=e?(0,i.Ku)(e):null;return t&&_(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&_(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return(0,r.xZ)(this.app)?Promise.reject(g(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,r.xZ)(this.app)?Promise.reject(g(this)):this.queue((async()=>{await this.assertedPersistence.setPersistence(ee(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e,t={}){return D(e,"GET","/v2/passwordPolicy",N(e,t))}(this),t=new ye(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new i.FA("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise(((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged((()=>{n(),e()}),t)}}))}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return D(e,"POST","/v2/accounts:revokeToken",N(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&ee(e)||this._popupRedirectResolver;_(t,this,"argument-error"),this.redirectPersistenceManager=await ie.create(this,[ee(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(e)))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"==typeof t?t:t.next.bind(t);let s=!1;const o=this._isInitialized?Promise.resolve():this._initializationPromise;if(_(o,this,"internal-error"),o.then((()=>{s||i(this.currentUser)})),"function"==typeof t){const i=e.addObserver(t,n,r);return()=>{s=!0,i()}}{const n=e.addObserver(t);return()=>{s=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return _(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=me(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){h.logLevel<=s.$b.WARN&&h.warn(`Auth (${r.MF}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function ve(e){return(0,i.Ku)(e)}class be{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,i.tD)((e=>this.observer=e))}get next(){return _(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let we={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Ee(e){return we.loadJS(e)}function Se(e){return`__${e}${Math.floor(1e6*Math.random())}`}class Te{constructor(e){this.type="recaptcha-enterprise",this.auth=ve(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;F(i)?i.enterprise.ready((()=>{i.enterprise.execute(t,{action:e}).then((e=>{n(e)})).catch((()=>{n("NO_RECAPTCHA")}))})):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise(((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise((async(t,n)=>{U(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then((r=>{if(void 0!==r.recaptchaKey){const n=new j(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))})).catch((e=>{n(e)}))}))})(this.auth).then((i=>{if(!t&&F(window.grecaptcha))n(i,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=we.recaptchaEnterpriseScript;0!==t.length&&(t+=i),Ee(t).then((()=>{n(i,e,r)})).catch((e=>{r(e)}))}})).catch((e=>{r(e)}))}))}}async function Ce(e,t,n,r=!1){const i=new Te(e);let s;try{s=await i.verify(n)}catch(e){s=await i.verify(n,!0)}const o=Object.assign({},t);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Ie(e,t,n,r){var i;if(null===(i=e._getRecaptchaConfig())||void 0===i?void 0:i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await Ce(e,t,n,"getOobCode"===n);return r(e,i)}return r(e,t).catch((async i=>{if("auth/missing-recaptcha-token"===i.code){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const i=await Ce(e,t,n,"getOobCode"===n);return r(e,i)}return Promise.reject(i)}))}function ke(e,t,n){const r=ve(e);_(r._canInitEmulator,r,"emulator-config-failed"),_(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),s=Ae(t),{host:o,port:a}=function(e){const t=Ae(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:Ne(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Ne(t)}}}(t),u=null===a?"":`:${a}`;r.config.emulator={url:`${s}//${o}${u}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function Ae(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Ne(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class De{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return v("not implemented")}_getIdTokenResponse(e){return v("not implemented")}_linkToIdToken(e,t){return v("not implemented")}_getReauthenticationResolver(e){return v("not implemented")}}async function Pe(e,t){return D(e,"POST","/v1/accounts:signUp",t)}async function xe(e,t){return x(e,"POST","/v1/accounts:signInWithPassword",N(e,t))}class Re extends De{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Re(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Re(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Ie(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",xe);case"emailLink":return async function(e,t){return x(e,"POST","/v1/accounts:signInWithEmailLink",N(e,t))}(e,{email:this._email,oobCode:this._password});default:f(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Ie(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Pe);case"emailLink":return async function(e,t){return x(e,"POST","/v1/accounts:signInWithEmailLink",N(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:f(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Oe(e,t){return x(e,"POST","/v1/accounts:signInWithIdp",N(e,t))}class Le extends De{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Le(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):f("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=(0,o.__rest)(t,["providerId","signInMethod"]);if(!n||!r)return null;const s=new Le(n,r);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){return Oe(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Oe(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Oe(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,i.Am)(t)}return e}}const Me={USER_NOT_FOUND:"user-not-found"};class Fe extends De{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Fe({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Fe({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return x(e,"POST","/v1/accounts:signInWithPhoneNumber",N(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await x(e,"POST","/v1/accounts:signInWithPhoneNumber",N(e,t));if(n.temporaryProof)throw M(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return x(e,"POST","/v1/accounts:signInWithPhoneNumber",N(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Me)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new Fe({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class je{constructor(e){var t,n,r,s,o,a;const u=(0,i.I9)((0,i.hp)(e)),l=null!==(t=u.apiKey)&&void 0!==t?t:null,c=null!==(n=u.oobCode)&&void 0!==n?n:null,h=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=u.mode)&&void 0!==r?r:null);_(l&&c&&h,"argument-error"),this.apiKey=l,this.operation=h,this.code=c,this.continueUrl=null!==(s=u.continueUrl)&&void 0!==s?s:null,this.languageCode=null!==(o=u.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(a=u.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=(0,i.I9)((0,i.hp)(e)).link,n=t?(0,i.I9)((0,i.hp)(t)).deep_link_id:null,r=(0,i.I9)((0,i.hp)(e)).deep_link_id;return(r?(0,i.I9)((0,i.hp)(r)).link:null)||r||n||t||e}(e);try{return new je(t)}catch(e){return null}}}class Ue{constructor(){this.providerId=Ue.PROVIDER_ID}static credential(e,t){return Re._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=je.parseLink(t);return _(n,"argument-error"),Re._fromEmailAndCode(e,n.code,n.tenantId)}}Ue.PROVIDER_ID="password",Ue.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Ue.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Be{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Ve extends Be{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class He extends Ve{constructor(){super("facebook.com")}static credential(e){return Le._fromParams({providerId:He.PROVIDER_ID,signInMethod:He.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return He.credentialFromTaggedObject(e)}static credentialFromError(e){return He.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return He.credential(e.oauthAccessToken)}catch(e){return null}}}He.FACEBOOK_SIGN_IN_METHOD="facebook.com",He.PROVIDER_ID="facebook.com";class ze extends Ve{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Le._fromParams({providerId:ze.PROVIDER_ID,signInMethod:ze.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return ze.credentialFromTaggedObject(e)}static credentialFromError(e){return ze.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return ze.credential(t,n)}catch(e){return null}}}ze.GOOGLE_SIGN_IN_METHOD="google.com",ze.PROVIDER_ID="google.com";class qe extends Ve{constructor(){super("github.com")}static credential(e){return Le._fromParams({providerId:qe.PROVIDER_ID,signInMethod:qe.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return qe.credentialFromTaggedObject(e)}static credentialFromError(e){return qe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return qe.credential(e.oauthAccessToken)}catch(e){return null}}}qe.GITHUB_SIGN_IN_METHOD="github.com",qe.PROVIDER_ID="github.com";class Ge extends Ve{constructor(){super("twitter.com")}static credential(e,t){return Le._fromParams({providerId:Ge.PROVIDER_ID,signInMethod:Ge.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Ge.credentialFromTaggedObject(e)}static credentialFromError(e){return Ge.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return Ge.credential(t,n)}catch(e){return null}}}async function $e(e,t){return x(e,"POST","/v1/accounts:signUp",N(e,t))}Ge.TWITTER_SIGN_IN_METHOD="twitter.com",Ge.PROVIDER_ID="twitter.com";class Ke{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await J._fromIdTokenResponse(e,n,r),s=We(n);return new Ke({user:i,providerId:s,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=We(n);return new Ke({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function We(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}async function Qe(e){var t;if((0,r.xZ)(e.app))return Promise.reject(g(e));const n=ve(e);if(await n._initializationPromise,null===(t=n.currentUser)||void 0===t?void 0:t.isAnonymous)return new Ke({user:n.currentUser,providerId:null,operationType:"signIn"});const i=await $e(n,{returnSecureToken:!0}),s=await Ke._fromIdTokenResponse(n,"signIn",i,!0);return await n._updateCurrentUser(s.user),s}class Ye extends i.g{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,Ye.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new Ye(e,t,n,r)}}function Xe(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw Ye._fromErrorAndOperation(e,n,t,r);throw n}))}async function Je(e,t,n=!1){const r=await G(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return Ke._forOperation(e,"link",r)}async function Ze(e,t,n=!1){const{auth:i}=e;if((0,r.xZ)(i.app))return Promise.reject(g(i));const s="reauthenticate";try{const r=await G(e,Xe(i,s,t,e),n);_(r.idToken,i,"internal-error");const o=z(r.idToken);_(o,i,"internal-error");const{sub:a}=o;return _(e.uid===a,i,"user-mismatch"),Ke._forOperation(e,s,r)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&f(i,"user-mismatch"),e}}async function et(e,t,n=!1){if((0,r.xZ)(e.app))return Promise.reject(g(e));const i="signIn",s=await Xe(e,i,t),o=await Ke._fromIdTokenResponse(e,i,s);return n||await e._updateCurrentUser(o.user),o}new WeakMap;const tt="__sak";class nt{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(tt,"1"),this.storage.removeItem(tt),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class rt extends nt{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=(0,i.ZQ)();return ae(e)||fe(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=pe(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys(((e,t,n)=>{this.notifyListeners(e,n)}));const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},s=this.storage.getItem(n);(0,i.lT)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}rt.type="LOCAL";const it=rt;class st extends nt{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(e,t){}_removeListener(e,t){}}st.type="SESSION";const ot=st;class at{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find((t=>t.isListeningto(e)));if(t)return t;const n=new at(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,s=this.handlersMap[r];if(!(null==s?void 0:s.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(s).map((async e=>e(t.origin,i))),a=await function(e){return Promise.all(e.map((async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}})))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function ut(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}at.receivers=[];class lt{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,s;return new Promise(((o,a)=>{const u=ut("",20);r.port1.start();const l=setTimeout((()=>{a(new Error("unsupported_event"))}),n);s={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===u)switch(t.data.status){case"ack":clearTimeout(l),i=setTimeout((()=>{a(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),o(t.data.response);break;default:clearTimeout(l),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:u,data:t},[r.port2])})).finally((()=>{s&&this.removeMessageHandler(s)}))}}function ct(){return window}function ht(){return void 0!==ct().WorkerGlobalScope&&"function"==typeof ct().importScripts}const dt="firebaseLocalStorageDb",ft="firebaseLocalStorage",pt="fbase_key";class mt{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}function gt(e,t){return e.transaction([ft],t?"readwrite":"readonly").objectStore(ft)}function yt(){const e=indexedDB.open(dt,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(ft,{keyPath:pt})}catch(e){n(e)}})),e.addEventListener("success",(async()=>{const n=e.result;n.objectStoreNames.contains(ft)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(dt);return new mt(e).toPromise()}(),t(await yt()))}))}))}async function _t(e,t,n){const r=gt(e,!0).put({[pt]:t,value:n});return new mt(r).toPromise()}function vt(e,t){const n=gt(e,!0).delete(t);return new mt(n).toPromise()}class bt{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await yt()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return ht()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=at._getInstance(ht()?self:null),this.receiver._subscribe("keyChanged",(async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)}))),this.receiver._subscribe("ping",(async(e,t)=>["keyChanged"]))}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new lt(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await yt();return await _t(e,tt,"1"),await vt(e,tt),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite((async()=>(await this._withRetries((n=>_t(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){const t=await this._withRetries((t=>async function(e,t){const n=gt(e,!1).get(t),r=await new mt(n).toPromise();return void 0===r?null:r.value}(t,e)));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>vt(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){const e=await this._withRetries((e=>{const t=gt(e,!1).getAll();return new mt(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}bt.type="LOCAL";const wt=bt;Se("rcb"),new T(3e4,6e4);const Et="recaptcha";async function St(e,t,n){var r;const i=await n.verify();try{let s;if(_("string"==typeof i,e,"argument-error"),_(n.type===Et,e,"argument-error"),s="string"==typeof t?{phoneNumber:t}:t,"session"in s){const t=s.session;if("phoneNumber"in s){_("enroll"===t.type,e,"internal-error");const n=await function(e,t){return D(e,"POST","/v2/accounts/mfaEnrollment:start",N(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}});return n.phoneSessionInfo.sessionInfo}{_("signin"===t.type,e,"internal-error");const n=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;_(n,e,"missing-multi-factor-info");const o=await function(e,t){return D(e,"POST","/v2/accounts/mfaSignIn:start",N(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}});return o.phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return D(e,"POST","/v1/accounts:sendVerificationCode",N(e,t))}(e,{phoneNumber:s.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}class Tt{constructor(e){this.providerId=Tt.PROVIDER_ID,this.auth=ve(e)}verifyPhoneNumber(e,t){return St(this.auth,e,(0,i.Ku)(t))}static credential(e,t){return Fe._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Tt.credentialFromTaggedObject(t)}static credentialFromError(e){return Tt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?Fe._fromTokenResponse(t,n):null}}function Ct(e,t){return t?ee(t):(_(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Tt.PROVIDER_ID="phone",Tt.PHONE_SIGN_IN_METHOD="phone";class It extends De{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Oe(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Oe(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Oe(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function kt(e){return et(e.auth,new It(e),e.bypassAuthState)}function At(e){const{auth:t,user:n}=e;return _(n,t,"internal-error"),Ze(n,new It(e),e.bypassAuthState)}async function Nt(e){const{auth:t,user:n}=e;return _(n,t,"internal-error"),Je(n,new It(e),e.bypassAuthState)}class Dt{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}}))}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:s,type:o}=e;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return kt;case"linkViaPopup":case"linkViaRedirect":return Nt;case"reauthViaPopup":case"reauthViaRedirect":return At;default:f(this.auth,"internal-error")}}resolve(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){b(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Pt=new T(2e3,1e4);class xt extends Dt{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,xt.currentPopupAction&&xt.currentPopupAction.cancel(),xt.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return _(e,this.auth,"internal-error"),e}async onExecution(){b(1===this.filter.length,"Popup operations only handle one event");const e=ut();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch((e=>{this.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(e=>{e||this.reject(p(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(p(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,xt.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(p(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(e,Pt.get())};e()}}xt.currentPopupAction=null;const Rt="pendingRedirect",Ot=new Map;class Lt extends Dt{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=Ot.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=jt(t),r=Ft(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}Ot.set(this.auth._key(),e)}return this.bypassAuthState||Ot.set(this.auth._key(),(()=>Promise.resolve(null))),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Mt(e,t){Ot.set(e._key(),t)}function Ft(e){return ee(e._redirectPersistence)}function jt(e){return re(Rt,e.config.apiKey,e.name)}async function Ut(e,t,n=!1){if((0,r.xZ)(e.app))return Promise.reject(g(e));const i=ve(e),s=Ct(i,t),o=new Lt(i,s,n),a=await o.execute();return a&&!n&&(delete a.user._redirectEventId,await i._persistUserIfCurrent(a.user),await i._setRedirectUser(null,t)),a}class Bt{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ht(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!Ht(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(p(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Vt(e))}saveEventToCache(e){this.cachedEventUids.add(Vt(e)),this.lastProcessedEventTime=Date.now()}}function Vt(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function Ht({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}const zt=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,qt=/^https?/;async function Gt(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return D(e,"GET","/v1/projects",t)}(e);for(const e of t)try{if($t(e))return}catch(e){}f(e,"unauthorized-domain")}function $t(e){const t=w(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!qt.test(n))return!1;if(zt.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const Kt=new T(3e4,6e4);function Wt(){const e=ct().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function Qt(e){return new Promise(((t,n)=>{var r,i,s;function o(){Wt(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Wt(),n(p(e,"network-request-failed"))},timeout:Kt.get()})}if(null===(i=null===(r=ct().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(s=ct().gapi)||void 0===s?void 0:s.load)){const t=Se("iframefcb");return ct()[t]=()=>{gapi.load?o():n(p(e,"network-request-failed"))},Ee(`${we.gapiScript}?onload=${t}`).catch((e=>n(e)))}o()}})).catch((e=>{throw Yt=null,e}))}let Yt=null;const Xt=new T(5e3,15e3),Jt="__/auth/iframe",Zt="emulator/auth/iframe",en={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},tn=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function nn(e){const t=e.config;_(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?C(t,Zt):`https://${e.config.authDomain}/${Jt}`,s={apiKey:t.apiKey,appName:e.name,v:r.MF},o=tn.get(e.config.apiHost);o&&(s.eid=o);const a=e._getFrameworks();return a.length&&(s.fw=a.join(",")),`${n}?${(0,i.Am)(s).slice(1)}`}async function rn(e){const t=await function(e){return Yt=Yt||Qt(e),Yt}(e),n=ct().gapi;return _(n,e,"internal-error"),t.open({where:document.body,url:nn(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:en,dontclear:!0},(t=>new Promise((async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=p(e,"network-request-failed"),s=ct().setTimeout((()=>{r(i)}),Xt.get());function o(){ct().clearTimeout(s),n(t)}t.ping(o).then(o,(()=>{r(i)}))}))))}const sn={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class on{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function an(e,t,n,r=500,s=600){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let u="";const l=Object.assign(Object.assign({},sn),{width:r.toString(),height:s.toString(),top:o,left:a}),c=(0,i.ZQ)().toLowerCase();n&&(u=ue(c)?"_blank":n),oe(c)&&(t=t||"http://localhost",l.scrollbars="yes");const h=Object.entries(l).reduce(((e,[t,n])=>`${e}${t}=${n},`),"");if(function(e=(0,i.ZQ)()){var t;return fe(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(c)&&"_self"!==u)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",u),new on(null);const d=window.open(t||"",u,h);_(d,e,"popup-blocked");try{d.focus()}catch(e){}return new on(d)}const un="__/auth/handler",ln="emulator/auth/handler",cn=encodeURIComponent("fac");async function hn(e,t,n,s,o,a){_(e.config.authDomain,e,"auth-domain-config-required"),_(e.config.apiKey,e,"invalid-api-key");const u={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:s,v:r.MF,eventId:o};if(t instanceof Be){t.setDefaultLanguage(e.languageCode),u.providerId=t.providerId||"",(0,i.Im)(t.getCustomParameters())||(u.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(a||{}))u[e]=t}if(t instanceof Ve){const e=t.getScopes().filter((e=>""!==e));e.length>0&&(u.scopes=e.join(","))}e.tenantId&&(u.tid=e.tenantId);const l=u;for(const e of Object.keys(l))void 0===l[e]&&delete l[e];const c=await e._getAppCheckToken(),h=c?`#${cn}=${encodeURIComponent(c)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${un}`;return C(e,ln)}(e)}?${(0,i.Am)(l).slice(1)}${h}`}const dn="webStorageSupport";const fn=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ot,this._completeRedirectFn=Ut,this._overrideRedirectResult=Mt}async _openPopup(e,t,n,r){var i;b(null===(i=this.eventManagers[e._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()");return an(e,await hn(e,t,n,w(),r),ut())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){ct().location.href=e}(await hn(e,t,n,w(),r)),new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(b(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch((()=>{delete this.eventManagers[t]})),n}async initAndGetManager(e){const t=await rn(e),n=new Bt(e);return t.register("authEvent",(t=>{_(null==t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(dn,{type:dn},(n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[dn];void 0!==i&&t(!!i),f(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Gt(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return pe()||ae()||fe()}};var pn="@firebase/auth",mn="1.7.2";class gn{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged((t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){_(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const yn=(0,i.XA)("authIdTokenMaxAge")||300;let _n=null;const vn=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&((new Date).getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>yn)return;const i=null==n?void 0:n.token;_n!==i&&(_n=i,await fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function bn(e=(0,r.Sx)()){const t=(0,r.j6)(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=(0,r.j6)(e,"auth");if(n.isInitialized()){const e=n.getImmediate(),r=n.getOptions();if((0,i.bD)(r,null!=t?t:{}))return e;f(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:fn,persistence:[wt,it,ot]}),s=(0,i.XA)("authTokenSyncURL");if(s&&"boolean"==typeof isSecureContext&&isSecureContext){const e=new URL(s,location.origin);if(location.origin===e.origin){const t=vn(e.toString());!function(e,t,n){(0,i.Ku)(e).beforeAuthStateChanged(t,n)}(n,t,(()=>t(n.currentUser))),function(e,t,n,r){(0,i.Ku)(e).onIdTokenChanged(t,n,r)}(n,(e=>t(e)))}}const o=(0,i.Tj)("auth");return o&&ke(n,`http://${o}`),n}var wn;we={loadJS(e){return new Promise(((t,n)=>{const r=document.createElement("script");var i,s;r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=p("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(null!==(s=null===(i=document.getElementsByTagName("head"))||void 0===i?void 0:i[0])&&void 0!==s?s:document).appendChild(r)}))},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},wn="Browser",(0,r.om)(new a.uA("auth",((e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=n.options;_(s&&!s.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:s,authDomain:o,clientPlatform:wn,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:me(wn)},u=new _e(n,r,i,a);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(ee);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(u,t),u}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),(0,r.om)(new a.uA("auth-internal",(e=>(e=>new gn(e))(ve(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,r.KO)(pn,mn,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(wn)),(0,r.KO)(pn,mn,"esm2017")},"./node_modules/firebase/database/dist/esm/index.esm.js":function(e,t,n){"use strict";n.d(t,{C3:function(){return Gi},yX:function(){return Oi},Zy:function(){return Ui},KR:function(){return xi},hZ:function(){return Li}});var r=n("./node_modules/@firebase/app/dist/esm/index.esm2017.js"),i=n("./node_modules/@firebase/component/dist/esm/index.esm2017.js"),s=n("./node_modules/@firebase/util/dist/index.esm2017.js"),o=n("./node_modules/@firebase/logger/dist/esm/index.esm2017.js");const a="@firebase/database",u="1.0.4";let l="";function c(e){l=e}class h{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),(0,s.As)(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:(0,s.$L)(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}class d{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t}get(e){return(0,s.gR)(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}const f=function(e){try{if("undefined"!=typeof window&&void 0!==window[e]){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new h(t)}}catch(e){}return new d},p=f("localStorage"),m=f("sessionStorage"),g=new o.Vy("@firebase/database"),y=function(){let e=1;return function(){return e++}}(),_=function(e){const t=(0,s.kj)(e),n=new s.gz;n.update(t);const r=n.digest();return s.K3.encodeByteArray(r)},v=function(...e){let t="";for(let n=0;n<e.length;n++){const r=e[n];Array.isArray(r)||r&&"object"==typeof r&&"number"==typeof r.length?t+=v.apply(null,r):t+="object"==typeof r?(0,s.As)(r):r,t+=" "}return t};let b=null,w=!0;const E=function(e,t){(0,s.vA)(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(g.logLevel=o.$b.VERBOSE,b=g.log.bind(g),t&&m.set("logging_enabled",!0)):"function"==typeof e?b=e:(b=null,m.remove("logging_enabled"))},S=function(...e){if(!0===w&&(w=!1,null===b&&!0===m.get("logging_enabled")&&E(!0)),b){const t=v.apply(null,e);b(t)}},T=function(e){return function(...t){S(e,...t)}},C=function(...e){const t="FIREBASE INTERNAL ERROR: "+v(...e);g.error(t)},I=function(...e){const t=`FIREBASE FATAL ERROR: ${v(...e)}`;throw g.error(t),new Error(t)},k=function(...e){const t="FIREBASE WARNING: "+v(...e);g.warn(t)},A=function(e){return"number"==typeof e&&(e!=e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},N="[MIN_NAME]",D="[MAX_NAME]",P=function(e,t){if(e===t)return 0;if(e===N||t===D)return-1;if(t===N||e===D)return 1;{const n=U(e),r=U(t);return null!==n?null!==r?n-r==0?e.length-t.length:n-r:-1:null!==r?1:e<t?-1:1}},x=function(e,t){return e===t?0:e<t?-1:1},R=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+(0,s.As)(t))},O=function(e){if("object"!=typeof e||null===e)return(0,s.As)(e);const t=[];for(const n in e)t.push(n);t.sort();let n="{";for(let r=0;r<t.length;r++)0!==r&&(n+=","),n+=(0,s.As)(t[r]),n+=":",n+=O(e[t[r]]);return n+="}",n},L=function(e,t){const n=e.length;if(n<=t)return[e];const r=[];for(let i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function M(e,t){for(const n in e)e.hasOwnProperty(n)&&t(n,e[n])}const F=function(e){(0,s.vA)(!A(e),"Invalid JSON number");const t=1023;let n,r,i,o,a;0===e?(r=0,i=0,n=1/e==-1/0?1:0):(n=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(o=Math.min(Math.floor(Math.log(e)/Math.LN2),t),r=o+t,i=Math.round(e*Math.pow(2,52-o)-Math.pow(2,52))):(r=0,i=Math.round(e/Math.pow(2,-1074))));const u=[];for(a=52;a;a-=1)u.push(i%2?1:0),i=Math.floor(i/2);for(a=11;a;a-=1)u.push(r%2?1:0),r=Math.floor(r/2);u.push(n?1:0),u.reverse();const l=u.join("");let c="";for(a=0;a<64;a+=8){let e=parseInt(l.substr(a,8),2).toString(16);1===e.length&&(e="0"+e),c+=e}return c.toLowerCase()};const j=new RegExp("^-?(0*)\\d{1,10}$"),U=function(e){if(j.test(e)){const t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},B=function(e){try{e()}catch(e){setTimeout((()=>{const t=e.stack||"";throw k("Exception was thrown by user callback.",t),e}),Math.floor(0))}},V=function(e,t){const n=setTimeout(e,t);return"number"==typeof n&&"undefined"!=typeof Deno&&Deno.unrefTimer?Deno.unrefTimer(n):"object"==typeof n&&n.unref&&n.unref(),n};class H{constructor(e,t){this.appName_=e,this.appCheckProvider=t,this.appCheck=null==t?void 0:t.getImmediate({optional:!0}),this.appCheck||null==t||t.get().then((e=>this.appCheck=e))}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise(((t,n)=>{setTimeout((()=>{this.appCheck?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then((t=>t.addTokenListener(e)))}notifyForInvalidToken(){k(`Provided AppCheck credentials for the app named "${this.appName_}" are invalid. This usually indicates your app was not initialized correctly.`)}}class z{constructor(e,t,n){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit((e=>this.auth_=e))}getToken(e){return this.auth_?this.auth_.getToken(e).catch((e=>e&&"auth/token-not-initialized"===e.code?(S("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(e))):new Promise(((t,n)=>{setTimeout((()=>{this.auth_?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then((t=>t.addAuthTokenListener(e)))}removeTokenChangeListener(e){this.authProvider_.get().then((t=>t.removeAuthTokenListener(e)))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',k(e)}}class q{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}q.OWNER="owner";const G="5",$=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,K="ac",W="websocket",Q="long_polling";class Y{constructor(e,t,n,r,i=!1,s="",o=!1,a=!1){this.secure=t,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=s,this.includeNamespaceInQueryParams=o,this.isUsingEmulator=a,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=p.get("host:"+e)||this._host}isCacheableHost(){return"s-"===this.internalHost.substr(0,2)}isCustomHost(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&p.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${t}`}}function X(e,t,n){let r;if((0,s.vA)("string"==typeof t,"typeof type must == string"),(0,s.vA)("object"==typeof n,"typeof params must == object"),t===W)r=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==Q)throw new Error("Unknown connection type: "+t);r=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}(function(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams})(e)&&(n.ns=e.namespace);const i=[];return M(n,((e,t)=>{i.push(e+"="+t)})),r+i.join("&")}class J{constructor(){this.counters_={}}incrementCounter(e,t=1){(0,s.gR)(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return(0,s.A4)(this.counters_)}}const Z={},ee={};function te(e){const t=e.toString();return Z[t]||(Z[t]=new J),Z[t]}class ne{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,t){for(this.pendingResponses[e]=t;this.pendingResponses[this.currentResponseNum];){const e=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let t=0;t<e.length;++t)e[t]&&B((()=>{this.onMessage_(e[t])}));if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}const re="start";class ie{constructor(e,t,n,r,i,s,o){this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.transportSessionId=s,this.lastSessionId=o,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=T(e),this.stats_=te(t),this.urlFn=e=>(this.appCheckToken&&(e[K]=this.appCheckToken),X(t,Q,e))}open(e,t){this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new ne(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null}),Math.floor(3e4)),function(e){if((0,s.$g)()||"complete"===document.readyState)e();else{let t=!1;const n=function(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(()=>{"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((()=>{if(this.isClosed_)return;this.scriptTagHolder=new se(((...e)=>{const[t,n,r,i,s]=e;if(this.incrementIncomingBytes_(e),this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,t===re)this.id=n,this.password=r;else{if("close"!==t)throw new Error("Unrecognized command received: "+t);n?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(n,(()=>{this.onClosed_()}))):this.onClosed_()}}),((...e)=>{const[t,n]=e;this.incrementIncomingBytes_(e),this.myPacketOrderer.handleResponse(t,n)}),(()=>{this.onClosed_()}),this.urlFn);const e={};e[re]="t",e.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=this.scriptTagHolder.uniqueCallbackIdentifier),e.v=G,this.transportSessionId&&(e.s=this.transportSessionId),this.lastSessionId&&(e.ls=this.lastSessionId),this.applicationId&&(e.p=this.applicationId),this.appCheckToken&&(e[K]=this.appCheckToken),"undefined"!=typeof location&&location.hostname&&$.test(location.hostname)&&(e.r="f");const t=this.urlFn(e);this.log_("Connecting via long-poll to "+t),this.scriptTagHolder.addTag(t,(()=>{}))}))}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){ie.forceAllow_=!0}static forceDisallow(){ie.forceDisallow_=!0}static isAvailable(){return!(0,s.$g)()&&(!!ie.forceAllow_||!(ie.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI))}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=(0,s.As)(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=(0,s.KA)(t),r=L(n,1840);for(let e=0;e<r.length;e++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[e]),this.curSegmentNum++}addDisconnectPingFrame(e,t){if((0,s.$g)())return;this.myDisconnFrame=document.createElement("iframe");const n={dframe:"t"};n.id=e,n.pw=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const t=(0,s.As)(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)}}class se{constructor(e,t,n,r){if(this.onDisconnect=n,this.urlFn=r,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,(0,s.$g)())this.commandCB=e,this.onMessageCB=t;else{this.uniqueCallbackIdentifier=y(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=t,this.myIFrame=se.createIFrame_();let n="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,11)){n='<script>document.domain="'+document.domain+'";<\/script>'}const r="<html><body>"+n+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(r),this.myIFrame.doc.close()}catch(e){S("frame writing exception"),e.stack&&S(e.stack),S(e)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||S("No IE domain setting required")}catch(t){const n=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout((()=>{null!==this.myIFrame&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)}),Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;let t=this.urlFn(e),n="",r=0;for(;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;{const e=this.pendingSegs.shift();n=n+"&seg"+r+"="+e.seg+"&ts"+r+"="+e.ts+"&d"+r+"="+e.d,r++}}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1}enqueueSegment(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const n=()=>{this.outstandingRequests.delete(t),this.newRequest_()},r=setTimeout(n,Math.floor(25e3));this.addTag(e,(()=>{clearTimeout(r),n()}))}addTag(e,t){(0,s.$g)()?this.doNodeLongPoll(e,t):setTimeout((()=>{try{if(!this.sendNewPolls)return;const n=this.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){const e=n.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),t())},n.onerror=()=>{S("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch(e){}}),Math.floor(1))}}let oe=null;"undefined"!=typeof MozWebSocket?oe=MozWebSocket:"undefined"!=typeof WebSocket&&(oe=WebSocket);class ae{constructor(e,t,n,r,i,s,o){this.connId=e,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=T(this.connId),this.stats_=te(t),this.connURL=ae.connectionURL_(t,s,o,r,n),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,n,r,i){const o={};return o.v=G,!(0,s.$g)()&&"undefined"!=typeof location&&location.hostname&&$.test(location.hostname)&&(o.r="f"),t&&(o.s=t),n&&(o.ls=n),r&&(o[K]=r),i&&(o.p=i),X(e,W,o)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,p.set("previous_websocket_failure",!0);try{let e;if((0,s.$g)()){const t=this.nodeAdmin?"AdminNode":"Node";e={headers:{"User-Agent":`Firebase/${G}/${l}/${process.platform}/${t}`,"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(e.headers.Authorization=`Bearer ${this.authToken}`),this.appCheckToken&&(e.headers["X-Firebase-AppCheck"]=this.appCheckToken);const n={FIREBASE_API_KEY:"AIzaSyAMO8Kwj7ChDikQKJzA7KCp-LYkXDFcKYI",FIREBASE_APP_ID:"1:241782390439:web:c10021e740161f63d1a582",FIREBASE_AUTH_DOMAIN:"tst-project-b3fc3.firebaseapp.com",FIREBASE_DATABASE_URL:"https://tst-project-b3fc3-default-rtdb.europe-west1.firebasedatabase.app",FIREBASE_MESSAGING_SENDERID:"241782390439",FIREBASE_PROJECT_ID:"tst-project-b3fc3",FIREBASE_STORAGE_BUCKET:"tst-project-b3fc3.appspot.com",NODE_ENV:"production"},r=0===this.connURL.indexOf("wss://")?n.HTTPS_PROXY||n.https_proxy:n.HTTP_PROXY||n.http_proxy;r&&(e.proxy={origin:r})}this.mySock=new oe(this.connURL,[],e)}catch(e){this.log_("Error instantiating WebSocket.");const t=e.message||e.data;return t&&this.log_(t),void this.onClosed_()}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=e=>{this.handleIncomingFrame(e)},this.mySock.onerror=e=>{this.log_("WebSocket error.  Closing connection.");const t=e.message||e.data;t&&this.log_(t),this.onClosed_()}}start(){}static forceDisallow(){ae.forceDisallow_=!0}static isAvailable(){let e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(t);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==oe&&!ae.forceDisallow_}static previouslyFailed(){return p.isInMemoryStorage||!0===p.get("previous_websocket_failure")}markConnectionHealthy(){p.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const e=this.frames.join("");this.frames=null;const t=(0,s.$L)(e);this.onMessage(t)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if((0,s.vA)(null===this.frames,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(null===this.mySock)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{const e=this.extractFrameCount_(t);null!==e&&this.appendFrame_(e)}}send(e){this.resetKeepAlive();const t=(0,s.As)(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=L(t,16384);n.length>1&&this.sendString_(String(n.length));for(let e=0;e<n.length;e++)this.sendString_(n[e])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()}),Math.floor(45e3))}sendString_(e){try{this.mySock.send(e)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}ae.responsesRequiredToBeHealthy=2,ae.healthyTimeout=3e4;class ue{constructor(e){this.initTransports_(e)}static get ALL_TRANSPORTS(){return[ie,ae]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}initTransports_(e){const t=ae&&ae.isAvailable();let n=t&&!ae.previouslyFailed();if(e.webSocketOnly&&(t||k("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),n=!0),n)this.transports_=[ae];else{const e=this.transports_=[];for(const t of ue.ALL_TRANSPORTS)t&&t.isAvailable()&&e.push(t);ue.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}ue.globalTransportInitialized_=!1;class le{constructor(e,t,n,r,i,s,o,a,u,l){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=s,this.onReady_=o,this.onDisconnect_=a,this.onKill_=u,this.lastSessionId=l,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=T("c:"+this.id+":"),this.transportManager_=new ue(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((()=>{this.conn_&&this.conn_.open(t,n)}),Math.floor(0));const r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=V((()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>102400?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes.  Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>10240?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes.  Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))}),Math.floor(r)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{2!==this.state_&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if("t"in e){const t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=R("t",e),n=R("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=R("t",e),n=R("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=R("t",e);if("d"in e){const n=e.d;if("h"===t){const e=Object.assign({},n);this.repoInfo_.isUsingEmulator&&(e.h=this.repoInfo_.host),this.onHandshake_(e)}else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let e=0;e<this.pendingDataMessages.length;++e)this.onDataMessage_(this.pendingDataMessages[e]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?C("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):C("Unknown control packet command: "+t)}}onHandshake_(e){const t=e.ts,n=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.host=r,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),G!==n&&k("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.secondaryConn_),n=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(t,n),V((()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())}),Math.floor(6e4))}onReset_(e){this.log_("Reset packet received.  New host: "+e),this.repoInfo_.host=e,1===this.state_?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):V((()=>{this.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))}sendPingOnPrimaryIfNecessary_(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()}onConnectionLost_(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(p.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)}close(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}class ce{put(e,t,n,r){}merge(e,t,n,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,n){}onDisconnectMerge(e,t,n){}onDisconnectCancel(e,t){}reportStats(e){}}class he{constructor(e){this.allowedEvents_=e,this.listeners_={},(0,s.vA)(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...t){if(Array.isArray(this.listeners_[e])){const n=[...this.listeners_[e]];for(let e=0;e<n.length;e++)n[e].callback.apply(n[e].context,t)}}on(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});const r=this.getInitialEvent(e);r&&t.apply(n,r)}off(e,t,n){this.validateEventType_(e);const r=this.listeners_[e]||[];for(let e=0;e<r.length;e++)if(r[e].callback===t&&(!n||n===r[e].context))return void r.splice(e,1)}validateEventType_(e){(0,s.vA)(this.allowedEvents_.find((t=>t===e)),"Unknown event: "+e)}}class de extends he{constructor(){super(["online"]),this.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||(0,s.jZ)()||(window.addEventListener("online",(()=>{this.online_||(this.online_=!0,this.trigger("online",!0))}),!1),window.addEventListener("offline",(()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))}),!1))}static getInstance(){return new de}getInitialEvent(e){return(0,s.vA)("online"===e,"Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}const fe=32,pe=768;class me{constructor(e,t){if(void 0===t){this.pieces_=e.split("/");let t=0;for(let e=0;e<this.pieces_.length;e++)this.pieces_[e].length>0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"}}function ge(){return new me("")}function ye(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function _e(e){return e.pieces_.length-e.pieceNum_}function ve(e){let t=e.pieceNum_;return t<e.pieces_.length&&t++,new me(e.pieces_,t)}function be(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function we(e,t=0){return e.pieces_.slice(e.pieceNum_+t)}function Ee(e){if(e.pieceNum_>=e.pieces_.length)return null;const t=[];for(let n=e.pieceNum_;n<e.pieces_.length-1;n++)t.push(e.pieces_[n]);return new me(t,0)}function Se(e,t){const n=[];for(let t=e.pieceNum_;t<e.pieces_.length;t++)n.push(e.pieces_[t]);if(t instanceof me)for(let e=t.pieceNum_;e<t.pieces_.length;e++)n.push(t.pieces_[e]);else{const e=t.split("/");for(let t=0;t<e.length;t++)e[t].length>0&&n.push(e[t])}return new me(n,0)}function Te(e){return e.pieceNum_>=e.pieces_.length}function Ce(e,t){const n=ye(e),r=ye(t);if(null===n)return t;if(n===r)return Ce(ve(e),ve(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function Ie(e,t){const n=we(e,0),r=we(t,0);for(let e=0;e<n.length&&e<r.length;e++){const t=P(n[e],r[e]);if(0!==t)return t}return n.length===r.length?0:n.length<r.length?-1:1}function ke(e,t){if(_e(e)!==_e(t))return!1;for(let n=e.pieceNum_,r=t.pieceNum_;n<=e.pieces_.length;n++,r++)if(e.pieces_[n]!==t.pieces_[r])return!1;return!0}function Ae(e,t){let n=e.pieceNum_,r=t.pieceNum_;if(_e(e)>_e(t))return!1;for(;n<e.pieces_.length;){if(e.pieces_[n]!==t.pieces_[r])return!1;++n,++r}return!0}class Ne{constructor(e,t){this.errorPrefix_=t,this.parts_=we(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let e=0;e<this.parts_.length;e++)this.byteLength_+=(0,s.OE)(this.parts_[e]);De(this)}}function De(e){if(e.byteLength_>pe)throw new Error(e.errorPrefix_+"has a key path longer than "+pe+" bytes ("+e.byteLength_+").");if(e.parts_.length>fe)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+fe+") or object contains a cycle "+Pe(e))}function Pe(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"}class xe extends he{constructor(){let e,t;super(["visible"]),"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(t="visibilitychange",e="hidden"):void 0!==document.mozHidden?(t="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(t="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,(()=>{const t=!document[e];t!==this.visible_&&(this.visible_=t,this.trigger("visible",t))}),!1)}static getInstance(){return new xe}getInitialEvent(e){return(0,s.vA)("visible"===e,"Unknown event type: "+e),[this.visible_]}}const Re=1e3;class Oe extends ce{constructor(e,t,n,r,i,o,a,u){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=n,this.onConnectStatus_=r,this.onServerInfoUpdate_=i,this.authTokenProvider_=o,this.appCheckTokenProvider_=a,this.authOverride_=u,this.id=Oe.nextPersistentConnectionId_++,this.log_=T("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=Re,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,u&&!(0,s.$g)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");xe.getInstance().on("visible",this.onVisible_,this),-1===e.host.indexOf("fblocal")&&de.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,n){const r=++this.requestNumber_,i={r:r,a:e,b:t};this.log_((0,s.As)(i)),(0,s.vA)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)}get(e){this.initConnection_();const t=new s.cY,n={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{const n=e.d;"ok"===e.s?t.resolve(n):t.reject(n)}};this.outstandingGets_.push(n),this.outstandingGetCount_++;const r=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(r),t.promise}listen(e,t,n,r){this.initConnection_();const i=e._queryIdentifier,o=e._path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),(0,s.vA)(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),(0,s.vA)(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");const a={onComplete:r,hashFn:t,query:e,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,(n=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(n)}))}sendListen_(e){const t=e.query,n=t._path.toString(),r=t._queryIdentifier;this.log_("Listen on "+n+" for "+r);const i={p:n};e.tag&&(i.q=t._queryObject,i.t=e.tag),i.h=e.hashFn(),this.sendRequest("q",i,(i=>{const s=i.d,o=i.s;Oe.warnOnListenWarnings_(s,t);(this.listens.get(n)&&this.listens.get(n).get(r))===e&&(this.log_("listen response",i),"ok"!==o&&this.removeListen_(n,r),e.onComplete&&e.onComplete(o,s))}))}static warnOnListenWarnings_(e,t){if(e&&"object"==typeof e&&(0,s.gR)(e,"w")){const n=(0,s.yw)(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const e='".indexOn": "'+t._queryParams.getIndex().toString()+'"',n=t._path.toString();k(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${e} at ${n} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(()=>{})),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&40===e.length||(0,s.qc)(e))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(()=>{}))}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=(0,s.Cv)(e)?"auth":"gauth",n={cred:e};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(t,n,(t=>{const n=t.s,r=t.d||"error";this.authToken_===e&&("ok"===n?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,r))}))}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(e=>{const t=e.s,n=e.d||"error";"ok"===t?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,n)}))}unlisten(e,t){const n=e._path.toString(),r=e._queryIdentifier;this.log_("Unlisten called for "+n+" "+r),(0,s.vA)(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e._queryObject,t)}sendUnlisten_(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);const i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)}onDisconnectPut(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})}onDisconnectMerge(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,n,r){const i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,(e=>{r&&setTimeout((()=>{r(e.s,e.d)}),Math.floor(0))}))}put(e,t,n,r){this.putInternal("p",e,t,n,r)}merge(e,t,n,r){this.putInternal("m",e,t,n,r)}putInternal(e,t,n,r,i){this.initConnection_();const s={p:t,d:n};void 0!==i&&(s.h=i),this.outstandingPuts_.push({action:e,request:s,onComplete:r}),this.outstandingPutCount_++;const o=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(o):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,n,(n=>{this.log_(t+" response",n),delete this.outstandingPuts_[e],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),r&&r(n.s,n.d)}))}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,(e=>{if("ok"!==e.s){const t=e.d;this.log_("reportStats","Error sending stats: "+t)}}))}}onDataMessage_(e){if("r"in e){this.log_("from server: "+(0,s.As)(e));const t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):C("Unrecognized action received from server: "+(0,s.As)(e)+"\nAre you using the latest client?")}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){(0,s.vA)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((()=>{this.establishConnectionTimer_=null,this.establishConnection_()}),Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=Re,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=Re,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=Re),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const e=(new Date).getTime()-this.lastConnectionAttemptTime_;let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+Oe.nextConnectionId_++,i=this.lastSessionId;let o=!1,a=null;const u=function(){a?a.close():(o=!0,n())},l=function(e){(0,s.vA)(a,"sendRequest call when we're not connected not allowed."),a.sendRequest(e)};this.realtime_={close:u,sendRequest:l};const c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[s,u]=await Promise.all([this.authTokenProvider_.getToken(c),this.appCheckTokenProvider_.getToken(c)]);o?S("getToken() completed but was canceled"):(S("getToken() completed. Creating connection."),this.authToken_=s&&s.accessToken,this.appCheckToken_=u&&u.token,a=new le(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,n,(e=>{k(e+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")}),i))}catch(e){this.log_("Failed to get token: "+e),o||(this.repoInfo_.nodeAdmin&&k(e),u())}}}interrupt(e){S("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){S("Resuming connection for reason: "+e),delete this.interruptReasons_[e],(0,s.Im)(this.interruptReasons_)&&(this.reconnectDelay_=Re,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])}onListenRevoked_(e,t){let n;n=t?t.map((e=>O(e))).join("$"):"default";const r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")}removeListen_(e,t){const n=new me(e).toString();let r;if(this.listens.has(n)){const e=this.listens.get(n);r=e.get(t),e.delete(t),0===e.size&&this.listens.delete(n)}else r=void 0;return r}onAuthRevoked_(e,t){S("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){S("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let t="js";(0,s.$g)()&&(t=this.repoInfo_.nodeAdmin?"admin_node":"node"),e["sdk."+t+"."+l.replace(/\./g,"-")]=1,(0,s.jZ)()?e["framework.cordova"]=1:(0,s.lV)()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=de.getInstance().currentlyOnline();return(0,s.Im)(this.interruptReasons_)&&e}}Oe.nextPersistentConnectionId_=0,Oe.nextConnectionId_=0;class Le{constructor(e,t){this.name=e,this.node=t}static Wrap(e,t){return new Le(e,t)}}class Me{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,t){const n=new Le(N,e),r=new Le(N,t);return 0!==this.compare(n,r)}minPost(){return Le.MIN}}let Fe;class je extends Me{static get __EMPTY_NODE(){return Fe}static set __EMPTY_NODE(e){Fe=e}compare(e,t){return P(e.name,t.name)}isDefinedOn(e){throw(0,s.Hk)("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,t){return!1}minPost(){return Le.MIN}maxPost(){return new Le(D,Fe)}makePost(e,t){return(0,s.vA)("string"==typeof e,"KeyIndex indexValue must always be a string."),new Le(e,Fe)}toString(){return".key"}}const Ue=new je;class Be{constructor(e,t,n,r,i=null){this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];let s=1;for(;!e.isEmpty();)if(s=t?n(e.key,t):1,r&&(s*=-1),s<0)e=this.isReverse_?e.left:e.right;else{if(0===s){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}getNext(){if(0===this.nodeStack_.length)return null;let e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e}hasNext(){return this.nodeStack_.length>0}peek(){if(0===this.nodeStack_.length)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class Ve{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:Ve.RED,this.left=null!=r?r:He.EMPTY_NODE,this.right=null!=i?i:He.EMPTY_NODE}copy(e,t,n,r,i){return new Ve(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return He.EMPTY_NODE;let e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let n,r;if(n=this,t(e,n.key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return He.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,Ve.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,Ve.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}Ve.RED=!0,Ve.BLACK=!1;class He{constructor(e,t=He.EMPTY_NODE){this.comparator_=e,this.root_=t}insert(e,t){return new He(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,Ve.BLACK,null,null))}remove(e){return new He(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Ve.BLACK,null,null))}get(e){let t,n=this.root_;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t)return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null}getPredecessorKey(e){let t,n=this.root_,r=null;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new Be(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new Be(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new Be(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new Be(this.root_,null,this.comparator_,!0,e)}}function ze(e,t){return P(e.name,t.name)}function qe(e,t){return P(e,t)}let Ge;He.EMPTY_NODE=new class{copy(e,t,n,r,i){return this}insert(e,t,n){return new Ve(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}};const $e=function(e){return"number"==typeof e?"number:"+F(e):"string:"+e},Ke=function(e){if(e.isLeafNode()){const t=e.val();(0,s.vA)("string"==typeof t||"number"==typeof t||"object"==typeof t&&(0,s.gR)(t,".sv"),"Priority must be a string or number.")}else(0,s.vA)(e===Ge||e.isEmpty(),"priority of unexpected type.");(0,s.vA)(e===Ge||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};let We,Qe,Ye;class Xe{constructor(e,t=Xe.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=t,this.lazyHash_=null,(0,s.vA)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Ke(this.priorityNode_)}static set __childrenNodeConstructor(e){We=e}static get __childrenNodeConstructor(){return We}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new Xe(this.value_,e)}getImmediateChild(e){return".priority"===e?this.priorityNode_:Xe.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return Te(e)?this:".priority"===ye(e)?this.priorityNode_:Xe.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return".priority"===e?this.updatePriority(t):t.isEmpty()&&".priority"!==e?this:Xe.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const n=ye(e);return null===n?t:t.isEmpty()&&".priority"!==n?this:((0,s.vA)(".priority"!==n||1===_e(e),".priority must be the last token in a path"),this.updateImmediateChild(n,Xe.__childrenNodeConstructor.EMPTY_NODE.updateChild(ve(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(null===this.lazyHash_){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+$e(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",e+="number"===t?F(this.value_):this.value_,this.lazyHash_=_(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===Xe.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof Xe.__childrenNodeConstructor?-1:((0,s.vA)(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,n=typeof this.value_,r=Xe.VALUE_TYPE_ORDER.indexOf(t),i=Xe.VALUE_TYPE_ORDER.indexOf(n);return(0,s.vA)(r>=0,"Unknown leaf type: "+t),(0,s.vA)(i>=0,"Unknown leaf type: "+n),r===i?"object"===n?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:i-r}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){const t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1}}Xe.VALUE_TYPE_ORDER=["object","boolean","number","string"];const Je=new class extends Me{compare(e,t){const n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?P(e.name,t.name):i}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,t){return!e.getPriority().equals(t.getPriority())}minPost(){return Le.MIN}maxPost(){return new Le(D,new Xe("[PRIORITY-POST]",Ye))}makePost(e,t){const n=Qe(e);return new Le(t,new Xe("[PRIORITY-POST]",n))}toString(){return".priority"}},Ze=Math.log(2);class et{constructor(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/Ze,10)),this.current_=this.count-1;const n=(r=this.count,parseInt(Array(r+1).join("1"),2));var r;this.bits_=e+1&n}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const tt=function(e,t,n,r){e.sort(t);const i=function(t,r){const s=r-t;let o,a;if(0===s)return null;if(1===s)return o=e[t],a=n?n(o):o,new Ve(a,o.node,Ve.BLACK,null,null);{const u=parseInt(s/2,10)+t,l=i(t,u),c=i(u+1,r);return o=e[u],a=n?n(o):o,new Ve(a,o.node,Ve.BLACK,l,c)}},s=function(t){let r=null,s=null,o=e.length;const a=function(t,r){const s=o-t,a=o;o-=t;const l=i(s+1,a),c=e[s],h=n?n(c):c;u(new Ve(h,c.node,r,null,l))},u=function(e){r?(r.left=e,r=e):(s=e,r=e)};for(let e=0;e<t.count;++e){const n=t.nextBitIsOne(),r=Math.pow(2,t.count-(e+1));n?a(r,Ve.BLACK):(a(r,Ve.BLACK),a(r,Ve.RED))}return s}(new et(e.length));return new He(r||t,s)};let nt;const rt={};class it{constructor(e,t){this.indexes_=e,this.indexSet_=t}static get Default(){return(0,s.vA)(rt&&Je,"ChildrenNode.ts has not been loaded"),nt=nt||new it({".priority":rt},{".priority":Je}),nt}get(e){const t=(0,s.yw)(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof He?t:null}hasIndex(e){return(0,s.gR)(this.indexSet_,e.toString())}addIndex(e,t){(0,s.vA)(e!==Ue,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const n=[];let r=!1;const i=t.getIterator(Le.Wrap);let o,a=i.getNext();for(;a;)r=r||e.isDefinedOn(a.node),n.push(a),a=i.getNext();o=r?tt(n,e.getCompare()):rt;const u=e.toString(),l=Object.assign({},this.indexSet_);l[u]=e;const c=Object.assign({},this.indexes_);return c[u]=o,new it(c,l)}addToIndexes(e,t){const n=(0,s.kH)(this.indexes_,((n,r)=>{const i=(0,s.yw)(this.indexSet_,r);if((0,s.vA)(i,"Missing index implementation for "+r),n===rt){if(i.isDefinedOn(e.node)){const n=[],r=t.getIterator(Le.Wrap);let s=r.getNext();for(;s;)s.name!==e.name&&n.push(s),s=r.getNext();return n.push(e),tt(n,i.getCompare())}return rt}{const r=t.get(e.name);let i=n;return r&&(i=i.remove(new Le(e.name,r))),i.insert(e,e.node)}}));return new it(n,this.indexSet_)}removeFromIndexes(e,t){const n=(0,s.kH)(this.indexes_,(n=>{if(n===rt)return n;{const r=t.get(e.name);return r?n.remove(new Le(e.name,r)):n}}));return new it(n,this.indexSet_)}}let st;class ot{constructor(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Ke(this.priorityNode_),this.children_.isEmpty()&&(0,s.vA)(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}static get EMPTY_NODE(){return st||(st=new ot(new He(qe),null,it.Default))}isLeafNode(){return!1}getPriority(){return this.priorityNode_||st}updatePriority(e){return this.children_.isEmpty()?this:new ot(this.children_,e,this.indexMap_)}getImmediateChild(e){if(".priority"===e)return this.getPriority();{const t=this.children_.get(e);return null===t?st:t}}getChild(e){const t=ye(e);return null===t?this:this.getImmediateChild(t).getChild(ve(e))}hasChild(e){return null!==this.children_.get(e)}updateImmediateChild(e,t){if((0,s.vA)(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);{const n=new Le(e,t);let r,i;t.isEmpty()?(r=this.children_.remove(e),i=this.indexMap_.removeFromIndexes(n,this.children_)):(r=this.children_.insert(e,t),i=this.indexMap_.addToIndexes(n,this.children_));const s=r.isEmpty()?st:this.priorityNode_;return new ot(r,s,i)}}updateChild(e,t){const n=ye(e);if(null===n)return t;{(0,s.vA)(".priority"!==ye(e)||1===_e(e),".priority must be the last token in a path");const r=this.getImmediateChild(n).updateChild(ve(e),t);return this.updateImmediateChild(n,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let n=0,r=0,i=!0;if(this.forEachChild(Je,((s,o)=>{t[s]=o.val(e),n++,i&&ot.INTEGER_REGEXP_.test(s)?r=Math.max(r,Number(s)):i=!1})),!e&&i&&r<2*n){const e=[];for(const n in t)e[n]=t[n];return e}return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(null===this.lazyHash_){let e="";this.getPriority().isEmpty()||(e+="priority:"+$e(this.getPriority().val())+":"),this.forEachChild(Je,((t,n)=>{const r=n.hash();""!==r&&(e+=":"+t+":"+r)})),this.lazyHash_=""===e?"":_(e)}return this.lazyHash_}getPredecessorChildName(e,t,n){const r=this.resolveIndex_(n);if(r){const n=r.getPredecessorKey(new Le(e,t));return n?n.name:null}return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.minKey();return e&&e.name}return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new Le(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.maxKey();return e&&e.name}return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new Le(t,this.children_.get(t)):null}forEachChild(e,t){const n=this.resolveIndex_(e);return n?n.inorderTraversal((e=>t(e.name,e.node))):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,(e=>e));{const n=this.children_.getIteratorFrom(e.name,Le.Wrap);let r=n.peek();for(;null!=r&&t.compare(r,e)<0;)n.getNext(),r=n.peek();return n}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,(e=>e));{const n=this.children_.getReverseIteratorFrom(e.name,Le.Wrap);let r=n.peek();for(;null!=r&&t.compare(r,e)>0;)n.getNext(),r=n.peek();return n}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===at?-1:0}withIndex(e){if(e===Ue||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new ot(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===Ue||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){const e=this.getIterator(Je),n=t.getIterator(Je);let r=e.getNext(),i=n.getNext();for(;r&&i;){if(r.name!==i.name||!r.node.equals(i.node))return!1;r=e.getNext(),i=n.getNext()}return null===r&&null===i}return!1}return!1}}resolveIndex_(e){return e===Ue?null:this.indexMap_.get(e.toString())}}ot.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;const at=new class extends ot{constructor(){super(new He(qe),ot.EMPTY_NODE,it.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return ot.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(Le,{MIN:{value:new Le(N,ot.EMPTY_NODE)},MAX:{value:new Le(D,at)}}),je.__EMPTY_NODE=ot.EMPTY_NODE,Xe.__childrenNodeConstructor=ot,Ge=at,function(e){Ye=e}(at);const ut=!0;function lt(e,t=null){if(null===e)return ot.EMPTY_NODE;if("object"==typeof e&&".priority"in e&&(t=e[".priority"]),(0,s.vA)(null===t||"string"==typeof t||"number"==typeof t||"object"==typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"==typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!=typeof e||".sv"in e){return new Xe(e,lt(t))}if(e instanceof Array||!ut){let n=ot.EMPTY_NODE;return M(e,((t,r)=>{if((0,s.gR)(e,t)&&"."!==t.substring(0,1)){const e=lt(r);!e.isLeafNode()&&e.isEmpty()||(n=n.updateImmediateChild(t,e))}})),n.updatePriority(lt(t))}{const n=[];let r=!1;if(M(e,((e,t)=>{if("."!==e.substring(0,1)){const i=lt(t);i.isEmpty()||(r=r||!i.getPriority().isEmpty(),n.push(new Le(e,i)))}})),0===n.length)return ot.EMPTY_NODE;const i=tt(n,ze,(e=>e.name),qe);if(r){const e=tt(n,Je.getCompare());return new ot(i,lt(t),new it({".priority":e},{".priority":Je}))}return new ot(i,lt(t),it.Default)}}!function(e){Qe=e}(lt);class ct extends Me{constructor(e){super(),this.indexPath_=e,(0,s.vA)(!Te(e)&&".priority"!==ye(e),"Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){const n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?P(e.name,t.name):i}makePost(e,t){const n=lt(e),r=ot.EMPTY_NODE.updateChild(this.indexPath_,n);return new Le(t,r)}maxPost(){const e=ot.EMPTY_NODE.updateChild(this.indexPath_,at);return new Le(D,e)}toString(){return we(this.indexPath_,0).join("/")}}const ht=new class extends Me{compare(e,t){const n=e.node.compareTo(t.node);return 0===n?P(e.name,t.name):n}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return Le.MIN}maxPost(){return Le.MAX}makePost(e,t){const n=lt(e);return new Le(t,n)}toString(){return".value"}};function dt(e){return{type:"value",snapshotNode:e}}function ft(e,t){return{type:"child_added",snapshotNode:t,childName:e}}function pt(e,t){return{type:"child_removed",snapshotNode:t,childName:e}}function mt(e,t,n){return{type:"child_changed",snapshotNode:t,childName:e,oldSnap:n}}class gt{constructor(e){this.index_=e}updateChild(e,t,n,r,i,o){(0,s.vA)(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const a=e.getImmediateChild(t);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()===n.isEmpty()?e:(null!=o&&(n.isEmpty()?e.hasChild(t)?o.trackChildChange(pt(t,a)):(0,s.vA)(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(ft(t,n)):o.trackChildChange(mt(t,n,a))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))}updateFullNode(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(Je,((e,r)=>{t.hasChild(e)||n.trackChildChange(pt(e,r))})),t.isLeafNode()||t.forEachChild(Je,((t,r)=>{if(e.hasChild(t)){const i=e.getImmediateChild(t);i.equals(r)||n.trackChildChange(mt(t,r,i))}else n.trackChildChange(ft(t,r))}))),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?ot.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}class yt{constructor(e){this.indexedFilter_=new gt(e.getIndex()),this.index_=e.getIndex(),this.startPost_=yt.getStartPost_(e),this.endPost_=yt.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,n=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&n}updateChild(e,t,n,r,i,s){return this.matches(new Le(t,n))||(n=ot.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,s)}updateFullNode(e,t,n){t.isLeafNode()&&(t=ot.EMPTY_NODE);let r=t.withIndex(this.index_);r=r.updatePriority(ot.EMPTY_NODE);const i=this;return t.forEachChild(Je,((e,t)=>{i.matches(new Le(e,t))||(r=r.updateImmediateChild(e,ot.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(e,r,n)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()}}class _t{constructor(e){this.withinDirectionalStart=e=>this.reverse_?this.withinEndPost(e):this.withinStartPost(e),this.withinDirectionalEnd=e=>this.reverse_?this.withinStartPost(e):this.withinEndPost(e),this.withinStartPost=e=>{const t=this.index_.compare(this.rangedFilter_.getStartPost(),e);return this.startIsInclusive_?t<=0:t<0},this.withinEndPost=e=>{const t=this.index_.compare(e,this.rangedFilter_.getEndPost());return this.endIsInclusive_?t<=0:t<0},this.rangedFilter_=new yt(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,n,r,i,s){return this.rangedFilter_.matches(new Le(t,n))||(n=ot.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,i,s):this.fullLimitUpdateChild_(e,t,n,i,s)}updateFullNode(e,t,n){let r;if(t.isLeafNode()||t.isEmpty())r=ot.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){let e;r=ot.EMPTY_NODE.withIndex(this.index_),e=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let n=0;for(;e.hasNext()&&n<this.limit_;){const t=e.getNext();if(this.withinDirectionalStart(t)){if(!this.withinDirectionalEnd(t))break;r=r.updateImmediateChild(t.name,t.node),n++}}}else{let e;r=t.withIndex(this.index_),r=r.updatePriority(ot.EMPTY_NODE),e=this.reverse_?r.getReverseIterator(this.index_):r.getIterator(this.index_);let n=0;for(;e.hasNext();){const t=e.getNext();n<this.limit_&&this.withinDirectionalStart(t)&&this.withinDirectionalEnd(t)?n++:r=r.updateImmediateChild(t.name,ot.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,t,n,r,i){let o;if(this.reverse_){const e=this.index_.getCompare();o=(t,n)=>e(n,t)}else o=this.index_.getCompare();const a=e;(0,s.vA)(a.numChildren()===this.limit_,"");const u=new Le(t,n),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),c=this.rangedFilter_.matches(u);if(a.hasChild(t)){const e=a.getImmediateChild(t);let s=r.getChildAfterChild(this.index_,l,this.reverse_);for(;null!=s&&(s.name===t||a.hasChild(s.name));)s=r.getChildAfterChild(this.index_,s,this.reverse_);const h=null==s?1:o(s,u);if(c&&!n.isEmpty()&&h>=0)return null!=i&&i.trackChildChange(mt(t,n,e)),a.updateImmediateChild(t,n);{null!=i&&i.trackChildChange(pt(t,e));const n=a.updateImmediateChild(t,ot.EMPTY_NODE);return null!=s&&this.rangedFilter_.matches(s)?(null!=i&&i.trackChildChange(ft(s.name,s.node)),n.updateImmediateChild(s.name,s.node)):n}}return n.isEmpty()?e:c&&o(l,u)>=0?(null!=i&&(i.trackChildChange(pt(l.name,l.node)),i.trackChildChange(ft(t,n))),a.updateImmediateChild(t,n).updateImmediateChild(l.name,ot.EMPTY_NODE)):e}}class vt{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Je}hasStart(){return this.startSet_}isViewFromLeft(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_}getIndexStartValue(){return(0,s.vA)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return(0,s.vA)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:N}hasEnd(){return this.endSet_}getIndexEndValue(){return(0,s.vA)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return(0,s.vA)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:D}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&""!==this.viewFrom_}getLimit(){return(0,s.vA)(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Je}copy(){const e=new vt;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function bt(e){const t={};if(e.isDefault())return t;let n;if(e.index_===Je?n="$priority":e.index_===ht?n="$value":e.index_===Ue?n="$key":((0,s.vA)(e.index_ instanceof ct,"Unrecognized index type!"),n=e.index_.toString()),t.orderBy=(0,s.As)(n),e.startSet_){const n=e.startAfterSet_?"startAfter":"startAt";t[n]=(0,s.As)(e.indexStartValue_),e.startNameSet_&&(t[n]+=","+(0,s.As)(e.indexStartName_))}if(e.endSet_){const n=e.endBeforeSet_?"endBefore":"endAt";t[n]=(0,s.As)(e.indexEndValue_),e.endNameSet_&&(t[n]+=","+(0,s.As)(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function wt(e){const t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let n=e.viewFrom_;""===n&&(n=e.isViewFromLeft()?"l":"r"),t.vf=n}return e.index_!==Je&&(t.i=e.index_.toString()),t}class Et extends ce{constructor(e,t,n,r){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=n,this.appCheckTokenProvider_=r,this.log_=T("p:rest:"),this.listens_={}}reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return void 0!==t?"tag$"+t:((0,s.vA)(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}listen(e,t,n,r){const i=e._path.toString();this.log_("Listen called for "+i+" "+e._queryIdentifier);const o=Et.getListenId_(e,n),a={};this.listens_[o]=a;const u=bt(e._queryParams);this.restRequest_(i+".json",u,((e,t)=>{let u=t;if(404===e&&(u=null,e=null),null===e&&this.onDataUpdate_(i,u,!1,n),(0,s.yw)(this.listens_,o)===a){let t;t=e?401===e?"permission_denied":"rest_error:"+e:"ok",r(t,null)}}))}unlisten(e,t){const n=Et.getListenId_(e,t);delete this.listens_[n]}get(e){const t=bt(e._queryParams),n=e._path.toString(),r=new s.cY;return this.restRequest_(n+".json",t,((e,t)=>{let i=t;404===e&&(i=null,e=null),null===e?(this.onDataUpdate_(n,i,!1,null),r.resolve(i)):r.reject(new Error(i))})),r.promise}refreshAuthToken(e){}restRequest_(e,t={},n){return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then((([r,i])=>{r&&r.accessToken&&(t.auth=r.accessToken),i&&i.token&&(t.ac=i.token);const o=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+(0,s.Am)(t);this.log_("Sending REST request for "+o);const a=new XMLHttpRequest;a.onreadystatechange=()=>{if(n&&4===a.readyState){this.log_("REST Response for "+o+" received. status:",a.status,"response:",a.responseText);let e=null;if(a.status>=200&&a.status<300){try{e=(0,s.$L)(a.responseText)}catch(e){k("Failed to parse JSON response for "+o+": "+a.responseText)}n(null,e)}else 401!==a.status&&404!==a.status&&k("Got unsuccessful REST response for "+o+" Status: "+a.status),n(a.status);n=null}},a.open("GET",o,!0),a.send()}))}}class St{constructor(){this.rootNode_=ot.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}}function Tt(){return{value:null,children:new Map}}function Ct(e,t,n){if(Te(t))e.value=n,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,n);else{const r=ye(t);e.children.has(r)||e.children.set(r,Tt());Ct(e.children.get(r),t=ve(t),n)}}function It(e,t){if(Te(t))return e.value=null,e.children.clear(),!0;if(null!==e.value){if(e.value.isLeafNode())return!1;{const n=e.value;return e.value=null,n.forEachChild(Je,((t,n)=>{Ct(e,new me(t),n)})),It(e,t)}}if(e.children.size>0){const n=ye(t);if(t=ve(t),e.children.has(n)){It(e.children.get(n),t)&&e.children.delete(n)}return 0===e.children.size}return!0}function kt(e,t,n){null!==e.value?n(t,e.value):function(e,t){e.children.forEach(((e,n)=>{t(n,e)}))}(e,((e,r)=>{kt(r,new me(t.toString()+"/"+e),n)}))}class At{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),t=Object.assign({},e);return this.last_&&M(this.last_,((e,n)=>{t[e]=t[e]-n})),this.last_=e,t}}class Nt{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new At(e);const n=1e4+2e4*Math.random();V(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const e=this.statsListener_.get(),t={};let n=!1;M(e,((e,r)=>{r>0&&(0,s.gR)(this.statsToReport_,e)&&(t[e]=r,n=!0)})),n&&this.server_.reportStats(t),V(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))}}var Dt;function Pt(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(Dt||(Dt={}));class xt{constructor(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=Dt.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}operationForChild(e){if(Te(this.path)){if(null!=this.affectedTree.value)return(0,s.vA)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new me(e));return new xt(ge(),t,this.revert)}}return(0,s.vA)(ye(this.path)===e,"operationForChild called for unrelated child."),new xt(ve(this.path),this.affectedTree,this.revert)}}class Rt{constructor(e,t){this.source=e,this.path=t,this.type=Dt.LISTEN_COMPLETE}operationForChild(e){return Te(this.path)?new Rt(this.source,ge()):new Rt(this.source,ve(this.path))}}class Ot{constructor(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=Dt.OVERWRITE}operationForChild(e){return Te(this.path)?new Ot(this.source,ge(),this.snap.getImmediateChild(e)):new Ot(this.source,ve(this.path),this.snap)}}class Lt{constructor(e,t,n){this.source=e,this.path=t,this.children=n,this.type=Dt.MERGE}operationForChild(e){if(Te(this.path)){const t=this.children.subtree(new me(e));return t.isEmpty()?null:t.value?new Ot(this.source,ge(),t.value):new Lt(this.source,ge(),t)}return(0,s.vA)(ye(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new Lt(this.source,ve(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}class Mt{constructor(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(Te(e))return this.isFullyInitialized()&&!this.filtered_;const t=ye(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}class Ft{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function jt(e,t,n,r,i,o){const a=r.filter((e=>e.type===n));a.sort(((t,n)=>function(e,t,n){if(null==t.childName||null==n.childName)throw(0,s.Hk)("Should only compare child_ events.");const r=new Le(t.childName,t.snapshotNode),i=new Le(n.childName,n.snapshotNode);return e.index_.compare(r,i)}(e,t,n))),a.forEach((n=>{const r=function(e,t,n){return"value"===t.type||"child_removed"===t.type||(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,n,o);i.forEach((i=>{i.respondsTo(n.type)&&t.push(i.createEvent(r,e.query_))}))}))}function Ut(e,t){return{eventCache:e,serverCache:t}}function Bt(e,t,n,r){return Ut(new Mt(t,n,r),e.serverCache)}function Vt(e,t,n,r){return Ut(e.eventCache,new Mt(t,n,r))}function Ht(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function zt(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}let qt;class Gt{constructor(e,t=(()=>(qt||(qt=new He(x)),qt))()){this.value=e,this.children=t}static fromObject(e){let t=new Gt(null);return M(e,((e,n)=>{t=t.set(new me(e),n)})),t}isEmpty(){return null===this.value&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(null!=this.value&&t(this.value))return{path:ge(),value:this.value};if(Te(e))return null;{const n=ye(e),r=this.children.get(n);if(null!==r){const i=r.findRootMostMatchingPathAndValue(ve(e),t);if(null!=i){return{path:Se(new me(n),i.path),value:i.value}}return null}return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,(()=>!0))}subtree(e){if(Te(e))return this;{const t=ye(e),n=this.children.get(t);return null!==n?n.subtree(ve(e)):new Gt(null)}}set(e,t){if(Te(e))return new Gt(t,this.children);{const n=ye(e),r=(this.children.get(n)||new Gt(null)).set(ve(e),t),i=this.children.insert(n,r);return new Gt(this.value,i)}}remove(e){if(Te(e))return this.children.isEmpty()?new Gt(null):new Gt(null,this.children);{const t=ye(e),n=this.children.get(t);if(n){const r=n.remove(ve(e));let i;return i=r.isEmpty()?this.children.remove(t):this.children.insert(t,r),null===this.value&&i.isEmpty()?new Gt(null):new Gt(this.value,i)}return this}}get(e){if(Te(e))return this.value;{const t=ye(e),n=this.children.get(t);return n?n.get(ve(e)):null}}setTree(e,t){if(Te(e))return t;{const n=ye(e),r=(this.children.get(n)||new Gt(null)).setTree(ve(e),t);let i;return i=r.isEmpty()?this.children.remove(n):this.children.insert(n,r),new Gt(this.value,i)}}fold(e){return this.fold_(ge(),e)}fold_(e,t){const n={};return this.children.inorderTraversal(((r,i)=>{n[r]=i.fold_(Se(e,r),t)})),t(e,this.value,n)}findOnPath(e,t){return this.findOnPath_(e,ge(),t)}findOnPath_(e,t,n){const r=!!this.value&&n(t,this.value);if(r)return r;if(Te(e))return null;{const r=ye(e),i=this.children.get(r);return i?i.findOnPath_(ve(e),Se(t,r),n):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,ge(),t)}foreachOnPath_(e,t,n){if(Te(e))return this;{this.value&&n(t,this.value);const r=ye(e),i=this.children.get(r);return i?i.foreachOnPath_(ve(e),Se(t,r),n):new Gt(null)}}foreach(e){this.foreach_(ge(),e)}foreach_(e,t){this.children.inorderTraversal(((n,r)=>{r.foreach_(Se(e,n),t)})),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal(((t,n)=>{n.value&&e(t,n.value)}))}}class $t{constructor(e){this.writeTree_=e}static empty(){return new $t(new Gt(null))}}function Kt(e,t,n){if(Te(t))return new $t(new Gt(n));{const r=e.writeTree_.findRootMostValueAndPath(t);if(null!=r){const i=r.path;let s=r.value;const o=Ce(i,t);return s=s.updateChild(o,n),new $t(e.writeTree_.set(i,s))}{const r=new Gt(n),i=e.writeTree_.setTree(t,r);return new $t(i)}}}function Wt(e,t,n){let r=e;return M(n,((e,n)=>{r=Kt(r,Se(t,e),n)})),r}function Qt(e,t){if(Te(t))return $t.empty();{const n=e.writeTree_.setTree(t,new Gt(null));return new $t(n)}}function Yt(e,t){return null!=Xt(e,t)}function Xt(e,t){const n=e.writeTree_.findRootMostValueAndPath(t);return null!=n?e.writeTree_.get(n.path).getChild(Ce(n.path,t)):null}function Jt(e){const t=[],n=e.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(Je,((e,n)=>{t.push(new Le(e,n))})):e.writeTree_.children.inorderTraversal(((e,n)=>{null!=n.value&&t.push(new Le(e,n.value))})),t}function Zt(e,t){if(Te(t))return e;{const n=Xt(e,t);return new $t(null!=n?new Gt(n):e.writeTree_.subtree(t))}}function en(e){return e.writeTree_.isEmpty()}function tn(e,t){return nn(ge(),e.writeTree_,t)}function nn(e,t,n){if(null!=t.value)return n.updateChild(e,t.value);{let r=null;return t.children.inorderTraversal(((t,i)=>{".priority"===t?((0,s.vA)(null!==i.value,"Priority writes must always be leaf nodes"),r=i.value):n=nn(Se(e,t),i,n)})),n.getChild(e).isEmpty()||null===r||(n=n.updateChild(Se(e,".priority"),r)),n}}function rn(e,t){return yn(t,e)}function sn(e,t){const n=e.allWrites.findIndex((e=>e.writeId===t));(0,s.vA)(n>=0,"removeWrite called with nonexistent writeId.");const r=e.allWrites[n];e.allWrites.splice(n,1);let i=r.visible,o=!1,a=e.allWrites.length-1;for(;i&&a>=0;){const t=e.allWrites[a];t.visible&&(a>=n&&on(t,r.path)?i=!1:Ae(r.path,t.path)&&(o=!0)),a--}if(i){if(o)return function(e){e.visibleWrites=un(e.allWrites,an,ge()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0;if(r.snap)e.visibleWrites=Qt(e.visibleWrites,r.path);else{M(r.children,(t=>{e.visibleWrites=Qt(e.visibleWrites,Se(r.path,t))}))}return!0}return!1}function on(e,t){if(e.snap)return Ae(e.path,t);for(const n in e.children)if(e.children.hasOwnProperty(n)&&Ae(Se(e.path,n),t))return!0;return!1}function an(e){return e.visible}function un(e,t,n){let r=$t.empty();for(let i=0;i<e.length;++i){const o=e[i];if(t(o)){const e=o.path;let t;if(o.snap)Ae(n,e)?(t=Ce(n,e),r=Kt(r,t,o.snap)):Ae(e,n)&&(t=Ce(e,n),r=Kt(r,ge(),o.snap.getChild(t)));else{if(!o.children)throw(0,s.Hk)("WriteRecord should have .snap or .children");if(Ae(n,e))t=Ce(n,e),r=Wt(r,t,o.children);else if(Ae(e,n))if(t=Ce(e,n),Te(t))r=Wt(r,ge(),o.children);else{const e=(0,s.yw)(o.children,ye(t));if(e){const n=e.getChild(ve(t));r=Kt(r,ge(),n)}}}}}return r}function ln(e,t,n,r,i){if(r||i){const s=Zt(e.visibleWrites,t);if(!i&&en(s))return n;if(i||null!=n||Yt(s,ge())){const s=function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(Ae(e.path,t)||Ae(t,e.path))};return tn(un(e.allWrites,s,t),n||ot.EMPTY_NODE)}return null}{const r=Xt(e.visibleWrites,t);if(null!=r)return r;{const r=Zt(e.visibleWrites,t);if(en(r))return n;if(null!=n||Yt(r,ge())){return tn(r,n||ot.EMPTY_NODE)}return null}}}function cn(e,t,n,r){return ln(e.writeTree,e.treePath,t,n,r)}function hn(e,t){return function(e,t,n){let r=ot.EMPTY_NODE;const i=Xt(e.visibleWrites,t);if(i)return i.isLeafNode()||i.forEachChild(Je,((e,t)=>{r=r.updateImmediateChild(e,t)})),r;if(n){const i=Zt(e.visibleWrites,t);return n.forEachChild(Je,((e,t)=>{const n=tn(Zt(i,new me(e)),t);r=r.updateImmediateChild(e,n)})),Jt(i).forEach((e=>{r=r.updateImmediateChild(e.name,e.node)})),r}return Jt(Zt(e.visibleWrites,t)).forEach((e=>{r=r.updateImmediateChild(e.name,e.node)})),r}(e.writeTree,e.treePath,t)}function dn(e,t,n,r){return function(e,t,n,r,i){(0,s.vA)(r||i,"Either existingEventSnap or existingServerSnap must exist");const o=Se(t,n);if(Yt(e.visibleWrites,o))return null;{const t=Zt(e.visibleWrites,o);return en(t)?i.getChild(n):tn(t,i.getChild(n))}}(e.writeTree,e.treePath,t,n,r)}function fn(e,t){return function(e,t){return Xt(e.visibleWrites,t)}(e.writeTree,Se(e.treePath,t))}function pn(e,t,n,r,i,s){return function(e,t,n,r,i,s,o){let a;const u=Zt(e.visibleWrites,t),l=Xt(u,ge());if(null!=l)a=l;else{if(null==n)return[];a=tn(u,n)}if(a=a.withIndex(o),a.isEmpty()||a.isLeafNode())return[];{const e=[],t=o.getCompare(),n=s?a.getReverseIteratorFrom(r,o):a.getIteratorFrom(r,o);let u=n.getNext();for(;u&&e.length<i;)0!==t(u,r)&&e.push(u),u=n.getNext();return e}}(e.writeTree,e.treePath,t,n,r,i,s)}function mn(e,t,n){return function(e,t,n,r){const i=Se(t,n),s=Xt(e.visibleWrites,i);if(null!=s)return s;if(r.isCompleteForChild(n))return tn(Zt(e.visibleWrites,i),r.getNode().getImmediateChild(n));return null}(e.writeTree,e.treePath,t,n)}function gn(e,t){return yn(Se(e.treePath,t),e.writeTree)}function yn(e,t){return{treePath:e,writeTree:t}}class _n{constructor(){this.changeMap=new Map}trackChildChange(e){const t=e.type,n=e.childName;(0,s.vA)("child_added"===t||"child_changed"===t||"child_removed"===t,"Only child changes supported for tracking"),(0,s.vA)(".priority"!==n,"Only non-priority child changes can be tracked.");const r=this.changeMap.get(n);if(r){const i=r.type;if("child_added"===t&&"child_removed"===i)this.changeMap.set(n,mt(n,e.snapshotNode,r.snapshotNode));else if("child_removed"===t&&"child_added"===i)this.changeMap.delete(n);else if("child_removed"===t&&"child_changed"===i)this.changeMap.set(n,pt(n,r.oldSnap));else if("child_changed"===t&&"child_added"===i)this.changeMap.set(n,ft(n,e.snapshotNode));else{if("child_changed"!==t||"child_changed"!==i)throw(0,s.Hk)("Illegal combination of changes: "+e+" occurred after "+r);this.changeMap.set(n,mt(n,e.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,e)}getChanges(){return Array.from(this.changeMap.values())}}const vn=new class{getCompleteChild(e){return null}getChildAfterChild(e,t,n){return null}};class bn{constructor(e,t,n=null){this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}getCompleteChild(e){const t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{const t=null!=this.optCompleteServerCache_?new Mt(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return mn(this.writes_,e,t)}}getChildAfterChild(e,t,n){const r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:zt(this.viewCache_),i=pn(this.writes_,r,t,1,n,e);return 0===i.length?null:i[0]}}function wn(e,t,n,r,i){const o=new _n;let a,u;if(n.type===Dt.OVERWRITE){const l=n;l.source.fromUser?a=Tn(e,t,l.path,l.snap,r,i,o):((0,s.vA)(l.source.fromServer,"Unknown source."),u=l.source.tagged||t.serverCache.isFiltered()&&!Te(l.path),a=Sn(e,t,l.path,l.snap,r,i,u,o))}else if(n.type===Dt.MERGE){const l=n;l.source.fromUser?a=function(e,t,n,r,i,s,o){let a=t;return r.foreach(((r,u)=>{const l=Se(n,r);Cn(t,ye(l))&&(a=Tn(e,a,l,u,i,s,o))})),r.foreach(((r,u)=>{const l=Se(n,r);Cn(t,ye(l))||(a=Tn(e,a,l,u,i,s,o))})),a}(e,t,l.path,l.children,r,i,o):((0,s.vA)(l.source.fromServer,"Unknown source."),u=l.source.tagged||t.serverCache.isFiltered(),a=kn(e,t,l.path,l.children,r,i,u,o))}else if(n.type===Dt.ACK_USER_WRITE){const u=n;a=u.revert?function(e,t,n,r,i,o){let a;if(null!=fn(r,n))return t;{const u=new bn(r,t,i),l=t.eventCache.getNode();let c;if(Te(n)||".priority"===ye(n)){let n;if(t.serverCache.isFullyInitialized())n=cn(r,zt(t));else{const e=t.serverCache.getNode();(0,s.vA)(e instanceof ot,"serverChildren would be complete if leaf node"),n=hn(r,e)}c=e.filter.updateFullNode(l,n,o)}else{const i=ye(n);let s=mn(r,i,t.serverCache);null==s&&t.serverCache.isCompleteForChild(i)&&(s=l.getImmediateChild(i)),c=null!=s?e.filter.updateChild(l,i,s,ve(n),u,o):t.eventCache.getNode().hasChild(i)?e.filter.updateChild(l,i,ot.EMPTY_NODE,ve(n),u,o):l,c.isEmpty()&&t.serverCache.isFullyInitialized()&&(a=cn(r,zt(t)),a.isLeafNode()&&(c=e.filter.updateFullNode(c,a,o)))}return a=t.serverCache.isFullyInitialized()||null!=fn(r,ge()),Bt(t,c,a,e.filter.filtersNodes())}}(e,t,u.path,r,i,o):function(e,t,n,r,i,s,o){if(null!=fn(i,n))return t;const a=t.serverCache.isFiltered(),u=t.serverCache;if(null!=r.value){if(Te(n)&&u.isFullyInitialized()||u.isCompleteForPath(n))return Sn(e,t,n,u.getNode().getChild(n),i,s,a,o);if(Te(n)){let r=new Gt(null);return u.getNode().forEachChild(Ue,((e,t)=>{r=r.set(new me(e),t)})),kn(e,t,n,r,i,s,a,o)}return t}{let l=new Gt(null);return r.foreach(((e,t)=>{const r=Se(n,e);u.isCompleteForPath(r)&&(l=l.set(e,u.getNode().getChild(r)))})),kn(e,t,n,l,i,s,a,o)}}(e,t,u.path,u.affectedTree,r,i,o)}else{if(n.type!==Dt.LISTEN_COMPLETE)throw(0,s.Hk)("Unknown operation type: "+n.type);a=function(e,t,n,r,i){const s=t.serverCache,o=Vt(t,s.getNode(),s.isFullyInitialized()||Te(n),s.isFiltered());return En(e,o,n,r,vn,i)}(e,t,n.path,r,o)}const l=o.getChanges();return function(e,t,n){const r=t.eventCache;if(r.isFullyInitialized()){const i=r.getNode().isLeafNode()||r.getNode().isEmpty(),s=Ht(e);(n.length>0||!e.eventCache.isFullyInitialized()||i&&!r.getNode().equals(s)||!r.getNode().getPriority().equals(s.getPriority()))&&n.push(dt(Ht(t)))}}(t,a,l),{viewCache:a,changes:l}}function En(e,t,n,r,i,o){const a=t.eventCache;if(null!=fn(r,n))return t;{let u,l;if(Te(n))if((0,s.vA)(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){const n=zt(t),i=hn(r,n instanceof ot?n:ot.EMPTY_NODE);u=e.filter.updateFullNode(t.eventCache.getNode(),i,o)}else{const n=cn(r,zt(t));u=e.filter.updateFullNode(t.eventCache.getNode(),n,o)}else{const c=ye(n);if(".priority"===c){(0,s.vA)(1===_e(n),"Can't have a priority with additional path components");const i=a.getNode();l=t.serverCache.getNode();const o=dn(r,n,i,l);u=null!=o?e.filter.updatePriority(i,o):a.getNode()}else{const s=ve(n);let h;if(a.isCompleteForChild(c)){l=t.serverCache.getNode();const e=dn(r,n,a.getNode(),l);h=null!=e?a.getNode().getImmediateChild(c).updateChild(s,e):a.getNode().getImmediateChild(c)}else h=mn(r,c,t.serverCache);u=null!=h?e.filter.updateChild(a.getNode(),c,h,s,i,o):a.getNode()}}return Bt(t,u,a.isFullyInitialized()||Te(n),e.filter.filtersNodes())}}function Sn(e,t,n,r,i,s,o,a){const u=t.serverCache;let l;const c=o?e.filter:e.filter.getIndexedFilter();if(Te(n))l=c.updateFullNode(u.getNode(),r,null);else if(c.filtersNodes()&&!u.isFiltered()){const e=u.getNode().updateChild(n,r);l=c.updateFullNode(u.getNode(),e,null)}else{const e=ye(n);if(!u.isCompleteForPath(n)&&_e(n)>1)return t;const i=ve(n),s=u.getNode().getImmediateChild(e).updateChild(i,r);l=".priority"===e?c.updatePriority(u.getNode(),s):c.updateChild(u.getNode(),e,s,i,vn,null)}const h=Vt(t,l,u.isFullyInitialized()||Te(n),c.filtersNodes());return En(e,h,n,i,new bn(i,h,s),a)}function Tn(e,t,n,r,i,s,o){const a=t.eventCache;let u,l;const c=new bn(i,t,s);if(Te(n))l=e.filter.updateFullNode(t.eventCache.getNode(),r,o),u=Bt(t,l,!0,e.filter.filtersNodes());else{const i=ye(n);if(".priority"===i)l=e.filter.updatePriority(t.eventCache.getNode(),r),u=Bt(t,l,a.isFullyInitialized(),a.isFiltered());else{const s=ve(n),l=a.getNode().getImmediateChild(i);let h;if(Te(s))h=r;else{const e=c.getCompleteChild(i);h=null!=e?".priority"===be(s)&&e.getChild(Ee(s)).isEmpty()?e:e.updateChild(s,r):ot.EMPTY_NODE}if(l.equals(h))u=t;else{u=Bt(t,e.filter.updateChild(a.getNode(),i,h,s,c,o),a.isFullyInitialized(),e.filter.filtersNodes())}}}return u}function Cn(e,t){return e.eventCache.isCompleteForChild(t)}function In(e,t,n){return n.foreach(((e,n)=>{t=t.updateChild(e,n)})),t}function kn(e,t,n,r,i,s,o,a){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let u,l=t;u=Te(n)?r:new Gt(null).setTree(n,r);const c=t.serverCache.getNode();return u.children.inorderTraversal(((n,r)=>{if(c.hasChild(n)){const u=In(0,t.serverCache.getNode().getImmediateChild(n),r);l=Sn(e,l,new me(n),u,i,s,o,a)}})),u.children.inorderTraversal(((n,r)=>{const u=!t.serverCache.isCompleteForChild(n)&&null===r.value;if(!c.hasChild(n)&&!u){const u=In(0,t.serverCache.getNode().getImmediateChild(n),r);l=Sn(e,l,new me(n),u,i,s,o,a)}})),l}class An{constructor(e,t){this.query_=e,this.eventRegistrations_=[];const n=this.query_._queryParams,r=new gt(n.getIndex()),i=(s=n).loadsAllData()?new gt(s.getIndex()):s.hasLimit()?new _t(s):new yt(s);var s;this.processor_=function(e){return{filter:e}}(i);const o=t.serverCache,a=t.eventCache,u=r.updateFullNode(ot.EMPTY_NODE,o.getNode(),null),l=i.updateFullNode(ot.EMPTY_NODE,a.getNode(),null),c=new Mt(u,o.isFullyInitialized(),r.filtersNodes()),h=new Mt(l,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=Ut(h,c),this.eventGenerator_=new Ft(this.query_)}get query(){return this.query_}}function Nn(e,t){const n=zt(e.viewCache_);return n&&(e.query._queryParams.loadsAllData()||!Te(t)&&!n.getImmediateChild(ye(t)).isEmpty())?n.getChild(t):null}function Dn(e){return 0===e.eventRegistrations_.length}function Pn(e,t,n){const r=[];if(n){(0,s.vA)(null==t,"A cancel should cancel all event registrations.");const i=e.query._path;e.eventRegistrations_.forEach((e=>{const t=e.createCancelEvent(n,i);t&&r.push(t)}))}if(t){let n=[];for(let r=0;r<e.eventRegistrations_.length;++r){const i=e.eventRegistrations_[r];if(i.matches(t)){if(t.hasAnyCallback()){n=n.concat(e.eventRegistrations_.slice(r+1));break}}else n.push(i)}e.eventRegistrations_=n}else e.eventRegistrations_=[];return r}function xn(e,t,n,r){t.type===Dt.MERGE&&null!==t.source.queryId&&((0,s.vA)(zt(e.viewCache_),"We should always have a full cache before handling merges"),(0,s.vA)(Ht(e.viewCache_),"Missing event cache, even though we have a server cache"));const i=e.viewCache_,o=wn(e.processor_,i,t,n,r);var a,u;return a=e.processor_,u=o.viewCache,(0,s.vA)(u.eventCache.getNode().isIndexed(a.filter.getIndex()),"Event snap not indexed"),(0,s.vA)(u.serverCache.getNode().isIndexed(a.filter.getIndex()),"Server snap not indexed"),(0,s.vA)(o.viewCache.serverCache.isFullyInitialized()||!i.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),e.viewCache_=o.viewCache,Rn(e,o.changes,o.viewCache.eventCache.getNode(),null)}function Rn(e,t,n,r){const i=r?[r]:e.eventRegistrations_;return function(e,t,n,r){const i=[],s=[];return t.forEach((t=>{var n;"child_changed"===t.type&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&s.push((n=t.childName,{type:"child_moved",snapshotNode:t.snapshotNode,childName:n}))})),jt(e,i,"child_removed",t,r,n),jt(e,i,"child_added",t,r,n),jt(e,i,"child_moved",s,r,n),jt(e,i,"child_changed",t,r,n),jt(e,i,"value",t,r,n),i}(e.eventGenerator_,t,n,i)}let On,Ln;class Mn{constructor(){this.views=new Map}}function Fn(e,t,n,r){const i=t.source.queryId;if(null!==i){const o=e.views.get(i);return(0,s.vA)(null!=o,"SyncTree gave us an op for an invalid query."),xn(o,t,n,r)}{let i=[];for(const s of e.views.values())i=i.concat(xn(s,t,n,r));return i}}function jn(e,t,n,r,i){const s=t._queryIdentifier,o=e.views.get(s);if(!o){let e=cn(n,i?r:null),s=!1;e?s=!0:r instanceof ot?(e=hn(n,r),s=!1):(e=ot.EMPTY_NODE,s=!1);const o=Ut(new Mt(e,s,!1),new Mt(r,i,!1));return new An(t,o)}return o}function Un(e,t,n,r,i,s){const o=jn(e,t,r,i,s);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,o),function(e,t){e.eventRegistrations_.push(t)}(o,n),function(e,t){const n=e.viewCache_.eventCache,r=[];n.getNode().isLeafNode()||n.getNode().forEachChild(Je,((e,t)=>{r.push(ft(e,t))}));return n.isFullyInitialized()&&r.push(dt(n.getNode())),Rn(e,r,n.getNode(),t)}(o,n)}function Bn(e,t,n,r){const i=t._queryIdentifier,o=[];let a=[];const u=Gn(e);if("default"===i)for(const[t,i]of e.views.entries())a=a.concat(Pn(i,n,r)),Dn(i)&&(e.views.delete(t),i.query._queryParams.loadsAllData()||o.push(i.query));else{const t=e.views.get(i);t&&(a=a.concat(Pn(t,n,r)),Dn(t)&&(e.views.delete(i),t.query._queryParams.loadsAllData()||o.push(t.query)))}return u&&!Gn(e)&&o.push(new((0,s.vA)(On,"Reference.ts has not been loaded"),On)(t._repo,t._path)),{removed:o,events:a}}function Vn(e){const t=[];for(const n of e.views.values())n.query._queryParams.loadsAllData()||t.push(n);return t}function Hn(e,t){let n=null;for(const r of e.views.values())n=n||Nn(r,t);return n}function zn(e,t){if(t._queryParams.loadsAllData())return $n(e);{const n=t._queryIdentifier;return e.views.get(n)}}function qn(e,t){return null!=zn(e,t)}function Gn(e){return null!=$n(e)}function $n(e){for(const t of e.views.values())if(t.query._queryParams.loadsAllData())return t;return null}let Kn=1;class Wn{constructor(e){this.listenProvider_=e,this.syncPointTree_=new Gt(null),this.pendingWriteTree_={visibleWrites:$t.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function Qn(e,t,n,r,i){return function(e,t,n,r,i){(0,s.vA)(r>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===i&&(i=!0),e.allWrites.push({path:t,snap:n,writeId:r,visible:i}),i&&(e.visibleWrites=Kt(e.visibleWrites,t,n)),e.lastWriteId=r}(e.pendingWriteTree_,t,n,r,i),i?nr(e,new Ot({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,n)):[]}function Yn(e,t,n=!1){const r=function(e,t){for(let n=0;n<e.allWrites.length;n++){const r=e.allWrites[n];if(r.writeId===t)return r}return null}(e.pendingWriteTree_,t);if(sn(e.pendingWriteTree_,t)){let t=new Gt(null);return null!=r.snap?t=t.set(ge(),!0):M(r.children,(e=>{t=t.set(new me(e),!0)})),nr(e,new xt(r.path,t,n))}return[]}function Xn(e,t,n){return nr(e,new Ot({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,n))}function Jn(e,t,n,r,i=!1){const s=t._path,o=e.syncPointTree_.get(s);let a=[];if(o&&("default"===t._queryIdentifier||qn(o,t))){const u=Bn(o,t,n,r);0===o.views.size&&(e.syncPointTree_=e.syncPointTree_.remove(s));const l=u.removed;if(a=u.events,!i){const n=-1!==l.findIndex((e=>e._queryParams.loadsAllData())),i=e.syncPointTree_.findOnPath(s,((e,t)=>Gn(t)));if(n&&!i){const t=e.syncPointTree_.subtree(s);if(!t.isEmpty()){const n=function(e){return e.fold(((e,t,n)=>{if(t&&Gn(t)){return[$n(t)]}{let e=[];return t&&(e=Vn(t)),M(n,((t,n)=>{e=e.concat(n)})),e}}))}(t);for(let t=0;t<n.length;++t){const r=n[t],i=r.query,s=sr(e,r);e.listenProvider_.startListening(hr(i),or(e,i),s.hashFn,s.onComplete)}}}if(!i&&l.length>0&&!r)if(n){const n=null;e.listenProvider_.stopListening(hr(t),n)}else l.forEach((t=>{const n=e.queryToTagMap.get(ar(t));e.listenProvider_.stopListening(hr(t),n)}))}!function(e,t){for(let n=0;n<t.length;++n){const r=t[n];if(!r._queryParams.loadsAllData()){const t=ar(r),n=e.queryToTagMap.get(t);e.queryToTagMap.delete(t),e.tagToQueryMap.delete(n)}}}(e,l)}return a}function Zn(e,t,n,r){const i=ur(e,r);if(null!=i){const r=lr(i),s=r.path,o=r.queryId,a=Ce(s,t);return cr(e,s,new Ot(Pt(o),a,n))}return[]}function er(e,t,n,r=!1){const i=t._path;let o=null,a=!1;e.syncPointTree_.foreachOnPath(i,((e,t)=>{const n=Ce(e,i);o=o||Hn(t,n),a=a||Gn(t)}));let u,l=e.syncPointTree_.get(i);if(l?(a=a||Gn(l),o=o||Hn(l,ge())):(l=new Mn,e.syncPointTree_=e.syncPointTree_.set(i,l)),null!=o)u=!0;else{u=!1,o=ot.EMPTY_NODE;e.syncPointTree_.subtree(i).foreachChild(((e,t)=>{const n=Hn(t,ge());n&&(o=o.updateImmediateChild(e,n))}))}const c=qn(l,t);if(!c&&!t._queryParams.loadsAllData()){const n=ar(t);(0,s.vA)(!e.queryToTagMap.has(n),"View does not exist, but we have a tag");const r=Kn++;e.queryToTagMap.set(n,r),e.tagToQueryMap.set(r,n)}let h=Un(l,t,n,rn(e.pendingWriteTree_,i),o,u);if(!c&&!a&&!r){const n=zn(l,t);h=h.concat(function(e,t,n){const r=t._path,i=or(e,t),o=sr(e,n),a=e.listenProvider_.startListening(hr(t),i,o.hashFn,o.onComplete),u=e.syncPointTree_.subtree(r);if(i)(0,s.vA)(!Gn(u.value),"If we're adding a query, it shouldn't be shadowed");else{const t=u.fold(((e,t,n)=>{if(!Te(e)&&t&&Gn(t))return[$n(t).query];{let e=[];return t&&(e=e.concat(Vn(t).map((e=>e.query)))),M(n,((t,n)=>{e=e.concat(n)})),e}}));for(let n=0;n<t.length;++n){const r=t[n];e.listenProvider_.stopListening(hr(r),or(e,r))}}return a}(e,t,n))}return h}function tr(e,t,n){const r=e.pendingWriteTree_,i=e.syncPointTree_.findOnPath(t,((e,n)=>{const r=Hn(n,Ce(e,t));if(r)return r}));return ln(r,t,i,n,!0)}function nr(e,t){return rr(t,e.syncPointTree_,null,rn(e.pendingWriteTree_,ge()))}function rr(e,t,n,r){if(Te(e.path))return ir(e,t,n,r);{const i=t.get(ge());null==n&&null!=i&&(n=Hn(i,ge()));let s=[];const o=ye(e.path),a=e.operationForChild(o),u=t.children.get(o);if(u&&a){const e=n?n.getImmediateChild(o):null,t=gn(r,o);s=s.concat(rr(a,u,e,t))}return i&&(s=s.concat(Fn(i,e,r,n))),s}}function ir(e,t,n,r){const i=t.get(ge());null==n&&null!=i&&(n=Hn(i,ge()));let s=[];return t.children.inorderTraversal(((t,i)=>{const o=n?n.getImmediateChild(t):null,a=gn(r,t),u=e.operationForChild(t);u&&(s=s.concat(ir(u,i,o,a)))})),i&&(s=s.concat(Fn(i,e,r,n))),s}function sr(e,t){const n=t.query,r=or(e,n);return{hashFn:()=>{const e=function(e){return e.viewCache_.serverCache.getNode()}(t)||ot.EMPTY_NODE;return e.hash()},onComplete:t=>{if("ok"===t)return r?function(e,t,n){const r=ur(e,n);if(r){const n=lr(r),i=n.path,s=n.queryId,o=Ce(i,t);return cr(e,i,new Rt(Pt(s),o))}return[]}(e,n._path,r):function(e,t){return nr(e,new Rt({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t))}(e,n._path);{const r=function(e,t){let n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===e?n="Client doesn't have permission to access the desired data.":"unavailable"===e&&(n="The service is unavailable");const r=new Error(e+" at "+t._path.toString()+": "+n);return r.code=e.toUpperCase(),r}(t,n);return Jn(e,n,null,r)}}}}function or(e,t){const n=ar(t);return e.queryToTagMap.get(n)}function ar(e){return e._path.toString()+"$"+e._queryIdentifier}function ur(e,t){return e.tagToQueryMap.get(t)}function lr(e){const t=e.indexOf("$");return(0,s.vA)(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new me(e.substr(0,t))}}function cr(e,t,n){const r=e.syncPointTree_.get(t);(0,s.vA)(r,"Missing sync point for query tag that we're tracking");return Fn(r,n,rn(e.pendingWriteTree_,t),null)}function hr(e){return e._queryParams.loadsAllData()&&!e._queryParams.isDefault()?new((0,s.vA)(Ln,"Reference.ts has not been loaded"),Ln)(e._repo,e._path):e}class dr{constructor(e){this.node_=e}getImmediateChild(e){const t=this.node_.getImmediateChild(e);return new dr(t)}node(){return this.node_}}class fr{constructor(e,t){this.syncTree_=e,this.path_=t}getImmediateChild(e){const t=Se(this.path_,e);return new fr(this.syncTree_,t)}node(){return tr(this.syncTree_,this.path_)}}const pr=function(e){return(e=e||{}).timestamp=e.timestamp||(new Date).getTime(),e},mr=function(e,t,n){return e&&"object"==typeof e?((0,s.vA)(".sv"in e,"Unexpected leaf node or priority contents"),"string"==typeof e[".sv"]?gr(e[".sv"],t,n):"object"==typeof e[".sv"]?yr(e[".sv"],t):void(0,s.vA)(!1,"Unexpected server value: "+JSON.stringify(e,null,2))):e},gr=function(e,t,n){if("timestamp"===e)return n.timestamp;(0,s.vA)(!1,"Unexpected server value: "+e)},yr=function(e,t,n){e.hasOwnProperty("increment")||(0,s.vA)(!1,"Unexpected server value: "+JSON.stringify(e,null,2));const r=e.increment;"number"!=typeof r&&(0,s.vA)(!1,"Unexpected increment value: "+r);const i=t.node();if((0,s.vA)(null!=i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;const o=i.getValue();return"number"!=typeof o?r:o+r},_r=function(e,t,n,r){return br(t,new fr(n,e),r)},vr=function(e,t,n){return br(e,new dr(t),n)};function br(e,t,n){const r=e.getPriority().val(),i=mr(r,t.getImmediateChild(".priority"),n);let s;if(e.isLeafNode()){const r=e,s=mr(r.getValue(),t,n);return s!==r.getValue()||i!==r.getPriority().val()?new Xe(s,lt(i)):e}{const r=e;return s=r,i!==r.getPriority().val()&&(s=s.updatePriority(new Xe(i))),r.forEachChild(Je,((e,r)=>{const i=br(r,t.getImmediateChild(e),n);i!==r&&(s=s.updateImmediateChild(e,i))})),s}}class wr{constructor(e="",t=null,n={children:{},childCount:0}){this.name=e,this.parent=t,this.node=n}}function Er(e,t){let n=t instanceof me?t:new me(t),r=e,i=ye(n);for(;null!==i;){const e=(0,s.yw)(r.node.children,i)||{children:{},childCount:0};r=new wr(i,r,e),n=ve(n),i=ye(n)}return r}function Sr(e){return e.node.value}function Tr(e,t){e.node.value=t,Nr(e)}function Cr(e){return e.node.childCount>0}function Ir(e,t){M(e.node.children,((n,r)=>{t(new wr(n,e,r))}))}function kr(e,t,n,r){n&&!r&&t(e),Ir(e,(e=>{kr(e,t,!0,r)})),n&&r&&t(e)}function Ar(e){return new me(null===e.parent?e.name:Ar(e.parent)+"/"+e.name)}function Nr(e){null!==e.parent&&function(e,t,n){const r=function(e){return void 0===Sr(e)&&!Cr(e)}(n),i=(0,s.gR)(e.node.children,t);r&&i?(delete e.node.children[t],e.node.childCount--,Nr(e)):r||i||(e.node.children[t]=n.node,e.node.childCount++,Nr(e))}(e.parent,e.name,e)}const Dr=/[\[\].#$\/\u0000-\u001F\u007F]/,Pr=/[\[\].#$\u0000-\u001F\u007F]/,xr=10485760,Rr=function(e){return"string"==typeof e&&0!==e.length&&!Dr.test(e)},Or=function(e){return"string"==typeof e&&0!==e.length&&!Pr.test(e)},Lr=function(e){return null===e||"string"==typeof e||"number"==typeof e&&!A(e)||e&&"object"==typeof e&&(0,s.gR)(e,".sv")},Mr=function(e,t,n,r){r&&void 0===t||Fr((0,s.dI)(e,"value"),t,n)},Fr=function(e,t,n){const r=n instanceof me?new Ne(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+Pe(r));if("function"==typeof t)throw new Error(e+"contains a function "+Pe(r)+" with contents = "+t.toString());if(A(t))throw new Error(e+"contains "+t.toString()+" "+Pe(r));if("string"==typeof t&&t.length>xr/3&&(0,s.OE)(t)>xr)throw new Error(e+"contains a string greater than "+xr+" utf8 bytes "+Pe(r)+" ('"+t.substring(0,50)+"...')");if(t&&"object"==typeof t){let n=!1,i=!1;if(M(t,((t,o)=>{if(".value"===t)n=!0;else if(".priority"!==t&&".sv"!==t&&(i=!0,!Rr(t)))throw new Error(e+" contains an invalid key ("+t+") "+Pe(r)+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');!function(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=(0,s.OE)(t),De(e)}(r,t),Fr(e,o,r),function(e){const t=e.parts_.pop();e.byteLength_-=(0,s.OE)(t),e.parts_.length>0&&(e.byteLength_-=1)}(r)})),n&&i)throw new Error(e+' contains ".value" child '+Pe(r)+" in addition to actual children.")}},jr=function(e,t,n,r){if(r&&void 0===t)return;const i=(0,s.dI)(e,"values");if(!t||"object"!=typeof t||Array.isArray(t))throw new Error(i+" must be an object containing the children to replace.");const o=[];M(t,((e,t)=>{const r=new me(e);if(Fr(i,t,Se(n,r)),".priority"===be(r)&&!Lr(t))throw new Error(i+"contains an invalid value for '"+r.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(r)})),function(e,t){let n,r;for(n=0;n<t.length;n++){r=t[n];const i=we(r);for(let t=0;t<i.length;t++)if(".priority"===i[t]&&t===i.length-1);else if(!Rr(i[t]))throw new Error(e+"contains an invalid key ("+i[t]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"')}t.sort(Ie);let i=null;for(n=0;n<t.length;n++){if(r=t[n],null!==i&&Ae(i,r))throw new Error(e+"contains a path "+i.toString()+" that is ancestor of another path "+r.toString());i=r}}(i,o)},Ur=function(e,t,n){if(!n||void 0!==t){if(A(t))throw new Error((0,s.dI)(e,"priority")+"is "+t.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Lr(t))throw new Error((0,s.dI)(e,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Br=function(e,t,n,r){if(!(r&&void 0===n||Or(n)))throw new Error((0,s.dI)(e,t)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},Vr=function(e,t,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),Br(e,t,n,r)},Hr=function(e,t){if(".info"===ye(t))throw new Error(e+" failed = Can't modify data under /.info/")},zr=function(e,t){const n=t.path.toString();if("string"!=typeof t.repoInfo.host||0===t.repoInfo.host.length||!Rr(t.repoInfo.namespace)&&"localhost"!==t.repoInfo.host.split(":")[0]||0!==n.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),Or(e)}(n))throw new Error((0,s.dI)(e,"url")+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')};class qr{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Gr(e,t){let n=null;for(let r=0;r<t.length;r++){const i=t[r],s=i.getPath();null===n||ke(s,n.path)||(e.eventLists_.push(n),n=null),null===n&&(n={events:[],path:s}),n.events.push(i)}n&&e.eventLists_.push(n)}function $r(e,t,n){Gr(e,n),Wr(e,(e=>ke(e,t)))}function Kr(e,t,n){Gr(e,n),Wr(e,(e=>Ae(e,t)||Ae(t,e)))}function Wr(e,t){e.recursionDepth_++;let n=!0;for(let r=0;r<e.eventLists_.length;r++){const i=e.eventLists_[r];if(i){t(i.path)?(Qr(e.eventLists_[r]),e.eventLists_[r]=null):n=!1}}n&&(e.eventLists_=[]),e.recursionDepth_--}function Qr(e){for(let t=0;t<e.events.length;t++){const n=e.events[t];if(null!==n){e.events[t]=null;const r=n.getEventRunner();b&&S("event: "+n.toString()),B(r)}}}const Yr="repo_interrupt",Xr=25;class Jr{constructor(e,t,n,r){this.repoInfo_=e,this.forceRestClient_=t,this.authTokenProvider_=n,this.appCheckProvider_=r,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new qr,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Tt(),this.transactionQueueTree_=new wr,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function Zr(e,t,n){if(e.stats_=te(e.repoInfo_),e.forceRestClient_||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)e.server_=new Et(e.repoInfo_,((t,n,r,i)=>{ni(e,t,n,r,i)}),e.authTokenProvider_,e.appCheckProvider_),setTimeout((()=>ri(e,!0)),0);else{if(null!=n){if("object"!=typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{(0,s.As)(n)}catch(e){throw new Error("Invalid authOverride provided: "+e)}}e.persistentConnection_=new Oe(e.repoInfo_,t,((t,n,r,i)=>{ni(e,t,n,r,i)}),(t=>{ri(e,t)}),(t=>{!function(e,t){M(t,((t,n)=>{ii(e,t,n)}))}(e,t)}),e.authTokenProvider_,e.appCheckProvider_,n),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener((t=>{e.server_.refreshAuthToken(t)})),e.appCheckProvider_.addTokenChangeListener((t=>{e.server_.refreshAppCheckToken(t.token)})),e.statsReporter_=function(e,t){const n=e.toString();return ee[n]||(ee[n]=t()),ee[n]}(e.repoInfo_,(()=>new Nt(e.stats_,e.server_))),e.infoData_=new St,e.infoSyncTree_=new Wn({startListening:(t,n,r,i)=>{let s=[];const o=e.infoData_.getNode(t._path);return o.isEmpty()||(s=Xn(e.infoSyncTree_,t._path,o),setTimeout((()=>{i("ok")}),0)),s},stopListening:()=>{}}),ii(e,"connected",!1),e.serverSyncTree_=new Wn({startListening:(t,n,r,i)=>(e.server_.listen(t,r,n,((n,r)=>{const s=i(n,r);Kr(e.eventQueue_,t._path,s)})),[]),stopListening:(t,n)=>{e.server_.unlisten(t,n)}})}function ei(e){const t=e.infoData_.getNode(new me(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function ti(e){return pr({timestamp:ei(e)})}function ni(e,t,n,r,i){e.dataUpdateCount++;const o=new me(t);n=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,n):n;let a=[];if(i)if(r){const t=(0,s.kH)(n,(e=>lt(e)));a=function(e,t,n,r){const i=ur(e,r);if(i){const r=lr(i),s=r.path,o=r.queryId,a=Ce(s,t),u=Gt.fromObject(n);return cr(e,s,new Lt(Pt(o),a,u))}return[]}(e.serverSyncTree_,o,t,i)}else{const t=lt(n);a=Zn(e.serverSyncTree_,o,t,i)}else if(r){const t=(0,s.kH)(n,(e=>lt(e)));a=function(e,t,n){const r=Gt.fromObject(n);return nr(e,new Lt({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,r))}(e.serverSyncTree_,o,t)}else{const t=lt(n);a=Xn(e.serverSyncTree_,o,t)}let u=o;a.length>0&&(u=mi(e,o)),Kr(e.eventQueue_,u,a)}function ri(e,t){ii(e,"connected",t),!1===t&&function(e){hi(e,"onDisconnectEvents");const t=ti(e),n=Tt();kt(e.onDisconnect_,ge(),((r,i)=>{const s=_r(r,i,e.serverSyncTree_,t);Ct(n,r,s)}));let r=[];kt(n,ge(),((t,n)=>{r=r.concat(Xn(e.serverSyncTree_,t,n));const i=bi(e,t);mi(e,i)})),e.onDisconnect_=Tt(),Kr(e.eventQueue_,ge(),r)}(e)}function ii(e,t,n){const r=new me("/.info/"+t),i=lt(n);e.infoData_.updateSnapshot(r,i);const s=Xn(e.infoSyncTree_,r,i);Kr(e.eventQueue_,r,s)}function si(e){return e.nextWriteId_++}function oi(e,t,n,r,i){hi(e,"set",{path:t.toString(),value:n,priority:r});const s=ti(e),o=lt(n,r),a=tr(e.serverSyncTree_,t),u=vr(o,a,s),l=si(e),c=Qn(e.serverSyncTree_,t,u,l,!0);Gr(e.eventQueue_,c),e.server_.put(t.toString(),o.val(!0),((n,r)=>{const s="ok"===n;s||k("set at "+t+" failed: "+n);const o=Yn(e.serverSyncTree_,l,!s);Kr(e.eventQueue_,t,o),di(e,i,n,r)}));const h=bi(e,t);mi(e,h),Kr(e.eventQueue_,h,[])}function ai(e,t,n){e.server_.onDisconnectCancel(t.toString(),((r,i)=>{"ok"===r&&It(e.onDisconnect_,t),di(e,n,r,i)}))}function ui(e,t,n,r){const i=lt(n);e.server_.onDisconnectPut(t.toString(),i.val(!0),((n,s)=>{"ok"===n&&Ct(e.onDisconnect_,t,i),di(e,r,n,s)}))}function li(e,t,n){let r;r=".info"===ye(t._path)?Jn(e.infoSyncTree_,t,n):Jn(e.serverSyncTree_,t,n),$r(e.eventQueue_,t._path,r)}function ci(e){e.persistentConnection_&&e.persistentConnection_.interrupt(Yr)}function hi(e,...t){let n="";e.persistentConnection_&&(n=e.persistentConnection_.id+":"),S(n,...t)}function di(e,t,n,r){t&&B((()=>{if("ok"===n)t(null);else{const e=(n||"error").toUpperCase();let i=e;r&&(i+=": "+r);const s=new Error(i);s.code=e,t(s)}}))}function fi(e,t,n){return tr(e.serverSyncTree_,t,n)||ot.EMPTY_NODE}function pi(e,t=e.transactionQueueTree_){if(t||vi(e,t),Sr(t)){const n=yi(e,t);(0,s.vA)(n.length>0,"Sending zero length transaction queue");n.every((e=>0===e.status))&&function(e,t,n){const r=n.map((e=>e.currentWriteId)),i=fi(e,t,r);let o=i;const a=i.hash();for(let e=0;e<n.length;e++){const r=n[e];(0,s.vA)(0===r.status,"tryToSendTransactionQueue_: items in queue should all be run."),r.status=1,r.retryCount++;const i=Ce(t,r.path);o=o.updateChild(i,r.currentOutputSnapshotRaw)}const u=o.val(!0),l=t;e.server_.put(l.toString(),u,(r=>{hi(e,"transaction put response",{path:l.toString(),status:r});let i=[];if("ok"===r){const r=[];for(let t=0;t<n.length;t++)n[t].status=2,i=i.concat(Yn(e.serverSyncTree_,n[t].currentWriteId)),n[t].onComplete&&r.push((()=>n[t].onComplete(null,!0,n[t].currentOutputSnapshotResolved))),n[t].unwatcher();vi(e,Er(e.transactionQueueTree_,t)),pi(e,e.transactionQueueTree_),Kr(e.eventQueue_,t,i);for(let e=0;e<r.length;e++)B(r[e])}else{if("datastale"===r)for(let e=0;e<n.length;e++)3===n[e].status?n[e].status=4:n[e].status=0;else{k("transaction at "+l.toString()+" failed: "+r);for(let e=0;e<n.length;e++)n[e].status=4,n[e].abortReason=r}mi(e,t)}}),a)}(e,Ar(t),n)}else Cr(t)&&Ir(t,(t=>{pi(e,t)}))}function mi(e,t){const n=gi(e,t),r=Ar(n);return function(e,t,n){if(0===t.length)return;const r=[];let i=[];const o=t.filter((e=>0===e.status)),a=o.map((e=>e.currentWriteId));for(let o=0;o<t.length;o++){const l=t[o],c=Ce(n,l.path);let h,d=!1;if((0,s.vA)(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),4===l.status)d=!0,h=l.abortReason,i=i.concat(Yn(e.serverSyncTree_,l.currentWriteId,!0));else if(0===l.status)if(l.retryCount>=Xr)d=!0,h="maxretry",i=i.concat(Yn(e.serverSyncTree_,l.currentWriteId,!0));else{const n=fi(e,l.path,a);l.currentInputSnapshot=n;const r=t[o].update(n.val());if(void 0!==r){Fr("transaction failed: Data returned ",r,l.path);let t=lt(r);"object"==typeof r&&null!=r&&(0,s.gR)(r,".priority")||(t=t.updatePriority(n.getPriority()));const o=l.currentWriteId,u=ti(e),c=vr(t,n,u);l.currentOutputSnapshotRaw=t,l.currentOutputSnapshotResolved=c,l.currentWriteId=si(e),a.splice(a.indexOf(o),1),i=i.concat(Qn(e.serverSyncTree_,l.path,c,l.currentWriteId,l.applyLocally)),i=i.concat(Yn(e.serverSyncTree_,o,!0))}else d=!0,h="nodata",i=i.concat(Yn(e.serverSyncTree_,l.currentWriteId,!0))}Kr(e.eventQueue_,n,i),i=[],d&&(t[o].status=2,u=t[o].unwatcher,setTimeout(u,Math.floor(0)),t[o].onComplete&&("nodata"===h?r.push((()=>t[o].onComplete(null,!1,t[o].currentInputSnapshot))):r.push((()=>t[o].onComplete(new Error(h),!1,null)))))}var u;vi(e,e.transactionQueueTree_);for(let e=0;e<r.length;e++)B(r[e]);pi(e,e.transactionQueueTree_)}(e,yi(e,n),r),r}function gi(e,t){let n,r=e.transactionQueueTree_;for(n=ye(t);null!==n&&void 0===Sr(r);)r=Er(r,n),n=ye(t=ve(t));return r}function yi(e,t){const n=[];return _i(e,t,n),n.sort(((e,t)=>e.order-t.order)),n}function _i(e,t,n){const r=Sr(t);if(r)for(let e=0;e<r.length;e++)n.push(r[e]);Ir(t,(t=>{_i(e,t,n)}))}function vi(e,t){const n=Sr(t);if(n){let e=0;for(let t=0;t<n.length;t++)2!==n[t].status&&(n[e]=n[t],e++);n.length=e,Tr(t,n.length>0?n:void 0)}Ir(t,(t=>{vi(e,t)}))}function bi(e,t){const n=Ar(gi(e,t)),r=Er(e.transactionQueueTree_,t);return function(e,t,n){let r=n?e:e.parent;for(;null!==r;){if(t(r))return!0;r=r.parent}}(r,(t=>{wi(e,t)})),wi(e,r),kr(r,(t=>{wi(e,t)})),n}function wi(e,t){const n=Sr(t);if(n){const r=[];let i=[],o=-1;for(let t=0;t<n.length;t++)3===n[t].status||(1===n[t].status?((0,s.vA)(o===t-1,"All SENT items should be at beginning of queue."),o=t,n[t].status=3,n[t].abortReason="set"):((0,s.vA)(0===n[t].status,"Unexpected transaction status in abort"),n[t].unwatcher(),i=i.concat(Yn(e.serverSyncTree_,n[t].currentWriteId,!0)),n[t].onComplete&&r.push(n[t].onComplete.bind(null,new Error("set"),!1,null))));-1===o?Tr(t,void 0):n.length=o+1,Kr(e.eventQueue_,Ar(t),i);for(let e=0;e<r.length;e++)B(r[e])}}const Ei=function(e,t){const n=Si(e),r=n.namespace;"firebase.com"===n.domain&&I(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||I("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&k("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");const i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new Y(n.host,n.secure,r,i,t,"",r!==n.subdomain),path:new me(n.pathString)}},Si=function(e){let t="",n="",r="",i="",s="",o=!0,a="https",u=443;if("string"==typeof e){let l=e.indexOf("//");l>=0&&(a=e.substring(0,l-1),e=e.substring(l+2));let c=e.indexOf("/");-1===c&&(c=e.length);let h=e.indexOf("?");-1===h&&(h=e.length),t=e.substring(0,Math.min(c,h)),c<h&&(i=function(e){let t="";const n=e.split("/");for(let e=0;e<n.length;e++)if(n[e].length>0){let r=n[e];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch(e){}t+="/"+r}return t}(e.substring(c,h)));const d=function(e){const t={};"?"===e.charAt(0)&&(e=e.substring(1));for(const n of e.split("&")){if(0===n.length)continue;const r=n.split("=");2===r.length?t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):k(`Invalid query segment '${n}' in query '${e}'`)}return t}(e.substring(Math.min(e.length,h)));l=t.indexOf(":"),l>=0?(o="https"===a||"wss"===a,u=parseInt(t.substring(l+1),10)):l=t.length;const f=t.slice(0,l);if("localhost"===f.toLowerCase())n="localhost";else if(f.split(".").length<=2)n=f;else{const e=t.indexOf(".");r=t.substring(0,e).toLowerCase(),n=t.substring(e+1),s=r}"ns"in d&&(s=d.ns)}return{host:t,port:u,domain:n,subdomain:r,secure:o,scheme:a,pathString:i,namespace:s}},Ti="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";!function(){let e=0;const t=[]}();class Ci{constructor(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}getPath(){const e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+(0,s.As)(this.snapshot.exportVal())}}class Ii{constructor(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}class ki{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return(0,s.vA)(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}class Ai{constructor(e,t){this._repo=e,this._path=t}cancel(){const e=new s.cY;return ai(this._repo,this._path,e.wrapCallback((()=>{}))),e.promise}remove(){Hr("OnDisconnect.remove",this._path);const e=new s.cY;return ui(this._repo,this._path,null,e.wrapCallback((()=>{}))),e.promise}set(e){Hr("OnDisconnect.set",this._path),Mr("OnDisconnect.set",e,this._path,!1);const t=new s.cY;return ui(this._repo,this._path,e,t.wrapCallback((()=>{}))),t.promise}setWithPriority(e,t){Hr("OnDisconnect.setWithPriority",this._path),Mr("OnDisconnect.setWithPriority",e,this._path,!1),Ur("OnDisconnect.setWithPriority",t,!1);const n=new s.cY;return function(e,t,n,r,i){const s=lt(n,r);e.server_.onDisconnectPut(t.toString(),s.val(!0),((n,r)=>{"ok"===n&&Ct(e.onDisconnect_,t,s),di(0,i,n,r)}))}(this._repo,this._path,e,t,n.wrapCallback((()=>{}))),n.promise}update(e){Hr("OnDisconnect.update",this._path),jr("OnDisconnect.update",e,this._path,!1);const t=new s.cY;return function(e,t,n,r){if((0,s.Im)(n))return S("onDisconnect().update() called with empty data.  Don't do anything."),void di(0,r,"ok",void 0);e.server_.onDisconnectMerge(t.toString(),n,((i,s)=>{"ok"===i&&M(n,((n,r)=>{const i=lt(r);Ct(e.onDisconnect_,Se(t,n),i)})),di(0,r,i,s)}))}(this._repo,this._path,e,t.wrapCallback((()=>{}))),t.promise}}class Ni{constructor(e,t,n,r){this._repo=e,this._path=t,this._queryParams=n,this._orderByCalled=r}get key(){return Te(this._path)?null:be(this._path)}get ref(){return new Di(this._repo,this._path)}get _queryIdentifier(){const e=wt(this._queryParams),t=O(e);return"{}"===t?"default":t}get _queryObject(){return wt(this._queryParams)}isEqual(e){if(!((e=(0,s.Ku)(e))instanceof Ni))return!1;const t=this._repo===e._repo,n=ke(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return t&&n&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+function(e){let t="";for(let n=e.pieceNum_;n<e.pieces_.length;n++)""!==e.pieces_[n]&&(t+="/"+encodeURIComponent(String(e.pieces_[n])));return t||"/"}(this._path)}}class Di extends Ni{constructor(e,t){super(e,t,new vt,!1)}get parent(){const e=Ee(this._path);return null===e?null:new Di(this._repo,e)}get root(){let e=this;for(;null!==e.parent;)e=e.parent;return e}}class Pi{constructor(e,t,n){this._node=e,this.ref=t,this._index=n}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const t=new me(e),n=Ri(this.ref,e);return new Pi(this._node.getChild(t),n,Je)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){if(this._node.isLeafNode())return!1;return!!this._node.forEachChild(this._index,((t,n)=>e(new Pi(n,Ri(this.ref,t),Je))))}hasChild(e){const t=new me(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return!this._node.isLeafNode()&&!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function xi(e,t){return(e=(0,s.Ku)(e))._checkNotDeleted("ref"),void 0!==t?Ri(e._root,t):e._root}function Ri(e,t){return null===ye((e=(0,s.Ku)(e))._path)?Vr("child","path",t,!1):Br("child","path",t,!1),new Di(e._repo,Se(e._path,t))}function Oi(e){return e=(0,s.Ku)(e),new Ai(e._repo,e._path)}function Li(e,t){e=(0,s.Ku)(e),Hr("set",e._path),Mr("set",t,e._path,!1);const n=new s.cY;return oi(e._repo,e._path,t,null,n.wrapCallback((()=>{}))),n.promise}class Mi{constructor(e){this.callbackContext=e}respondsTo(e){return"value"===e}createEvent(e,t){const n=t._queryParams.getIndex();return new Ci("value",this,new Pi(e.snapshotNode,new Di(t._repo,t._path),n))}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Ii(this,e,t):null}matches(e){return e instanceof Mi&&(!e.callbackContext||!this.callbackContext||e.callbackContext.matches(this.callbackContext))}hasAnyCallback(){return null!==this.callbackContext}}class Fi{constructor(e,t){this.eventType=e,this.callbackContext=t}respondsTo(e){let t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,this.eventType===t}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new Ii(this,e,t):null}createEvent(e,t){(0,s.vA)(null!=e.childName,"Child events should have a childName.");const n=Ri(new Di(t._repo,t._path),e.childName),r=t._queryParams.getIndex();return new Ci(e.type,this,new Pi(e.snapshotNode,n,r),e.prevName)}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof Fi&&(this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)))}hasAnyCallback(){return!!this.callbackContext}}function ji(e,t,n,r,i){let s;if("object"==typeof r&&(s=void 0,i=r),"function"==typeof r&&(s=r),i&&i.onlyOnce){const t=n,r=(n,r)=>{li(e._repo,e,a),t(n,r)};r.userCallback=n.userCallback,r.context=n.context,n=r}const o=new ki(n,s||void 0),a="value"===t?new Mi(o):new Fi(t,o);return function(e,t,n){let r;r=".info"===ye(t._path)?er(e.infoSyncTree_,t,n):er(e.serverSyncTree_,t,n),$r(e.eventQueue_,t._path,r)}(e._repo,e,a),()=>li(e._repo,e,a)}function Ui(e,t,n,r){return ji(e,"value",t,n,r)}!function(e){(0,s.vA)(!On,"__referenceConstructor has already been defined"),On=e}(Di),function(e){(0,s.vA)(!Ln,"__referenceConstructor has already been defined"),Ln=e}(Di);const Bi="FIREBASE_DATABASE_EMULATOR_HOST",Vi={};let Hi=!1;function zi(e,t,n,r,i){let s=r||e.options.databaseURL;void 0===s&&(e.options.projectId||I("Can't determine Firebase Database URL. Be sure to include  a Project ID when calling firebase.initializeApp()."),S("Using default host for project ",e.options.projectId),s=`${e.options.projectId}-default-rtdb.firebaseio.com`);let o,a,u=Ei(s,i),l=u.repoInfo;"undefined"!=typeof process&&(a={FIREBASE_API_KEY:"AIzaSyAMO8Kwj7ChDikQKJzA7KCp-LYkXDFcKYI",FIREBASE_APP_ID:"1:241782390439:web:c10021e740161f63d1a582",FIREBASE_AUTH_DOMAIN:"tst-project-b3fc3.firebaseapp.com",FIREBASE_DATABASE_URL:"https://tst-project-b3fc3-default-rtdb.europe-west1.firebasedatabase.app",FIREBASE_MESSAGING_SENDERID:"241782390439",FIREBASE_PROJECT_ID:"tst-project-b3fc3",FIREBASE_STORAGE_BUCKET:"tst-project-b3fc3.appspot.com",NODE_ENV:"production"}[Bi]),a?(o=!0,s=`http://${a}?ns=${l.namespace}`,u=Ei(s,i),l=u.repoInfo):o=!u.repoInfo.secure;const c=i&&o?new q(q.OWNER):new z(e.name,e.options,t);zr("Invalid Firebase Database URL",u),Te(u.path)||I("Database URL must point to the root of a Firebase Database (not including a child path).");const h=function(e,t,n,r){let i=Vi[t.name];i||(i={},Vi[t.name]=i);let s=i[e.toURLString()];s&&I("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return s=new Jr(e,Hi,n,r),i[e.toURLString()]=s,s}(l,e,c,new H(e.name,n));return new qi(h,e)}class qi{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(Zr(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new Di(this._repo,ge())),this._rootInternal}_delete(){return null!==this._rootInternal&&(!function(e,t){const n=Vi[t];n&&n[e.key]===e||I(`Database ${t}(${e.repoInfo_}) has already been deleted.`),ci(e),delete n[e.key]}(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){null===this._rootInternal&&I("Cannot call "+e+" on a deleted database.")}}function Gi(e=(0,r.Sx)(),t){const n=(0,r.j6)(e,"database").getImmediate({identifier:t});if(!n._instanceStarted){const e=(0,s.yU)("database");e&&function(e,t,n,r={}){e=(0,s.Ku)(e),e._checkNotDeleted("useEmulator"),e._instanceStarted&&I("Cannot call useEmulator() after instance has already been initialized.");const i=e._repoInternal;let o;if(i.repoInfo_.nodeAdmin)r.mockUserToken&&I('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),o=new q(q.OWNER);else if(r.mockUserToken){const t="string"==typeof r.mockUserToken?r.mockUserToken:(0,s.Fy)(r.mockUserToken,e.app.options.projectId);o=new q(t)}!function(e,t,n,r){e.repoInfo_=new Y(`${t}:${n}`,!1,e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams,!0),r&&(e.authTokenProvider_=r)}(i,t,n,o)}(n,...e)}return n}Oe.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},Oe.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};var $i;c(r.MF),(0,r.om)(new i.uA("database",((e,{instanceIdentifier:t})=>zi(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),t)),"PUBLIC").setMultipleInstances(!0)),(0,r.KO)(a,u,$i),(0,r.KO)(a,u,"esm2017")},"./node_modules/firebase/firestore/dist/esm/index.esm.js":function(e,t,n){"use strict";n.d(t,{Dc:function(){return ti},gS:function(){return Hh},rJ:function(){return jc},kd:function(){return Vh},CL:function(){return $h},H9:function(){return Uc},aU:function(){return zc},aQ:function(){return zh},P:function(){return Th},O5:function(){return Kh},BN:function(){return Uh},mZ:function(){return Bh},_M:function(){return Ih}});var r,i=n("./node_modules/@firebase/app/dist/esm/index.esm2017.js"),s=n("./node_modules/@firebase/component/dist/esm/index.esm2017.js"),o=n("./node_modules/@firebase/logger/dist/esm/index.esm2017.js"),a=n("./node_modules/@firebase/util/dist/index.esm2017.js"),u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l={},c=c||{},h=u||self;function d(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function f(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),m=0;function g(e,t,n){return e.call.apply(e.bind,arguments)}function y(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function _(e,t,n){return(_=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?g:y).apply(null,arguments)}function v(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function b(e,t){function n(){}n.prototype=t.prototype,e.$=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.ac=function(e,n,r){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return t.prototype[n].apply(e,i)}}function w(){this.s=this.s,this.o=this.o}w.prototype.s=!1,w.prototype.sa=function(){var e;!this.s&&(this.s=!0,this.N(),0)&&(e=this,Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++m))},w.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};const E=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(let n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1};function S(e){const t=e.length;if(0<t){const n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function T(e,t){for(let t=1;t<arguments.length;t++){const n=arguments[t];if(d(n)){const t=e.length||0,r=n.length||0;e.length=t+r;for(let i=0;i<r;i++)e[t+i]=n[i]}else e.push(n)}}function C(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}C.prototype.h=function(){this.defaultPrevented=!0};var I=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};h.addEventListener("test",e,t),h.removeEventListener("test",e,t)}catch(e){}return e}();function k(e){return/^[\s\xa0]*$/.test(e)}function A(){var e=h.navigator;return e&&(e=e.userAgent)?e:""}function N(e){return-1!=A().indexOf(e)}function D(e){return D[" "](e),e}D[" "]=function(){};var P,x,R,O=N("Opera"),L=N("Trident")||N("MSIE"),M=N("Edge"),F=M||L,j=N("Gecko")&&!(-1!=A().toLowerCase().indexOf("webkit")&&!N("Edge"))&&!(N("Trident")||N("MSIE"))&&!N("Edge"),U=-1!=A().toLowerCase().indexOf("webkit")&&!N("Edge");function B(){var e=h.document;return e?e.documentMode:void 0}e:{var V="",H=(x=A(),j?/rv:([^\);]+)(\)|;)/.exec(x):M?/Edge\/([\d\.]+)/.exec(x):L?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(x):U?/WebKit\/(\S+)/.exec(x):O?/(?:Version)[ \/]?(\S+)/.exec(x):void 0);if(H&&(V=H?H[1]:""),L){var z=B();if(null!=z&&z>parseFloat(V)){P=String(z);break e}}P=V}if(h.document&&L){var q=B();R=q||(parseInt(P,10)||void 0)}else R=void 0;var G=R;function $(e,t){if(C.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(j){e:{try{D(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:K[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&$.$.h.call(this)}}b($,C);var K={2:"touch",3:"pen",4:"mouse"};$.prototype.h=function(){$.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var W="closure_listenable_"+(1e6*Math.random()|0),Q=0;function Y(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.la=i,this.key=++Q,this.fa=this.ia=!1}function X(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function J(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function Z(e){const t={};for(const n in e)t[n]=e[n];return t}const ee="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function te(e,t){let n,r;for(let t=1;t<arguments.length;t++){for(n in r=arguments[t],r)e[n]=r[n];for(let t=0;t<ee.length;t++)n=ee[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function ne(e){this.src=e,this.g={},this.h=0}function re(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],s=E(i,t);(r=0<=s)&&Array.prototype.splice.call(i,s,1),r&&(X(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function ie(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i];if(!s.fa&&s.listener==t&&s.capture==!!n&&s.la==r)return i}return-1}ne.prototype.add=function(e,t,n,r,i){var s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);var o=ie(e,t,r,i);return-1<o?(t=e[o],n||(t.ia=!1)):((t=new Y(t,this.src,s,!!r,i)).ia=n,e.push(t)),t};var se="closure_lm_"+(1e6*Math.random()|0),oe={};function ae(e,t,n,r,i){if(r&&r.once)return le(e,t,n,r,i);if(Array.isArray(t)){for(var s=0;s<t.length;s++)ae(e,t[s],n,r,i);return null}return n=ge(n),e&&e[W]?e.O(t,n,f(r)?!!r.capture:!!r,i):ue(e,t,n,!1,r,i)}function ue(e,t,n,r,i,s){if(!t)throw Error("Invalid event type");var o=f(i)?!!i.capture:!!i,a=pe(e);if(a||(e[se]=a=new ne(e)),(n=a.add(t,n,r,o,s)).proxy)return n;if(r=function(){function e(n){return t.call(e.src,e.listener,n)}const t=fe;return e}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)I||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(de(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function le(e,t,n,r,i){if(Array.isArray(t)){for(var s=0;s<t.length;s++)le(e,t[s],n,r,i);return null}return n=ge(n),e&&e[W]?e.P(t,n,f(r)?!!r.capture:!!r,i):ue(e,t,n,!0,r,i)}function ce(e,t,n,r,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)ce(e,t[s],n,r,i);else r=f(r)?!!r.capture:!!r,n=ge(n),e&&e[W]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=ie(s=e.g[t],n,r,i))&&(X(s[n]),Array.prototype.splice.call(s,n,1),0==s.length&&(delete e.g[t],e.h--)))):e&&(e=pe(e))&&(t=e.g[t.toString()],e=-1,t&&(e=ie(t,n,r,i)),(n=-1<e?t[e]:null)&&he(n))}function he(e){if("number"!=typeof e&&e&&!e.fa){var t=e.src;if(t&&t[W])re(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(de(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=pe(t))?(re(n,e),0==n.h&&(n.src=null,t[se]=null)):X(e)}}}function de(e){return e in oe?oe[e]:oe[e]="on"+e}function fe(e,t){if(e.fa)e=!0;else{t=new $(t,this);var n=e.listener,r=e.la||e.src;e.ia&&he(e),e=n.call(r,t)}return e}function pe(e){return(e=e[se])instanceof ne?e:null}var me="__closure_events_fn_"+(1e9*Math.random()>>>0);function ge(e){return"function"==typeof e?e:(e[me]||(e[me]=function(t){return e.handleEvent(t)}),e[me])}function ye(){w.call(this),this.i=new ne(this),this.S=this,this.J=null}function _e(e,t){var n,r=e.J;if(r)for(n=[];r;r=r.J)n.push(r);if(e=e.S,r=t.type||t,"string"==typeof t)t=new C(t,e);else if(t instanceof C)t.target=t.target||e;else{var i=t;te(t=new C(r,e),i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=t.g=n[s];i=ve(o,r,!0,t)&&i}if(i=ve(o=t.g=e,r,!0,t)&&i,i=ve(o,r,!1,t)&&i,n)for(s=0;s<n.length;s++)i=ve(o=t.g=n[s],r,!1,t)&&i}function ve(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,s=0;s<t.length;++s){var o=t[s];if(o&&!o.fa&&o.capture==n){var a=o.listener,u=o.la||o.src;o.ia&&re(e.i,o),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}b(ye,w),ye.prototype[W]=!0,ye.prototype.removeEventListener=function(e,t,n,r){ce(this,e,t,n,r)},ye.prototype.N=function(){if(ye.$.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)X(n[r]);delete t.g[e],t.h--}}this.J=null},ye.prototype.O=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},ye.prototype.P=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};var be=h.JSON.stringify;function we(){var e=Ae;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var Ee=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}((()=>new Se),(e=>e.reset()));class Se{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}function Te(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function Ce(e){h.setTimeout((()=>{throw e}),0)}let Ie,ke=!1,Ae=new class{constructor(){this.h=this.g=null}add(e,t){const n=Ee.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},Ne=()=>{const e=h.Promise.resolve(void 0);Ie=()=>{e.then(De)}};var De=()=>{for(var e;e=we();){try{e.h.call(e.g)}catch(e){Ce(e)}var t=Ee;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}ke=!1};function Pe(e,t){ye.call(this),this.h=e||1,this.g=t||h,this.j=_(this.qb,this),this.l=Date.now()}function xe(e){e.ga=!1,e.T&&(e.g.clearTimeout(e.T),e.T=null)}function Re(e,t,n){if("function"==typeof e)n&&(e=_(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=_(e.handleEvent,e)}return 2147483647<Number(t)?-1:h.setTimeout(e,t||0)}function Oe(e){e.g=Re((()=>{e.g=null,e.i&&(e.i=!1,Oe(e))}),e.j);const t=e.h;e.h=null,e.m.apply(null,t)}b(Pe,ye),(r=Pe.prototype).ga=!1,r.T=null,r.qb=function(){if(this.ga){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-e):(this.T&&(this.g.clearTimeout(this.T),this.T=null),_e(this,"tick"),this.ga&&(xe(this),this.start()))}},r.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())},r.N=function(){Pe.$.N.call(this),xe(this),delete this.g};class Le extends w{constructor(e,t){super(),this.m=e,this.j=t,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:Oe(this)}N(){super.N(),this.g&&(h.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Me(e){w.call(this),this.h=e,this.g={}}b(Me,w);var Fe=[];function je(e,t,n,r){Array.isArray(n)||(n&&(Fe[0]=n.toString()),n=Fe);for(var i=0;i<n.length;i++){var s=ae(t,n[i],r||e.handleEvent,!1,e.h||e);if(!s)break;e.g[s.key]=s}}function Ue(e){J(e.g,(function(e,t){this.g.hasOwnProperty(t)&&he(e)}),e),e.g={}}function Be(){this.g=!0}function Ve(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var o=1;o<i.length;o++)i[o]=""}}}return be(n)}catch(e){return t}}(e,n)+(r?" "+r:"")}))}Me.prototype.N=function(){Me.$.N.call(this),Ue(this)},Me.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Be.prototype.Ea=function(){this.g=!1},Be.prototype.info=function(){};var He={},ze=null;function qe(){return ze=ze||new ye}function Ge(e){C.call(this,He.Ta,e)}function $e(e){const t=qe();_e(t,new Ge(t))}function Ke(e,t){C.call(this,He.STAT_EVENT,e),this.stat=t}function We(e){const t=qe();_e(t,new Ke(t,e))}function Qe(e,t){C.call(this,He.Ua,e),this.size=t}function Ye(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return h.setTimeout((function(){e()}),t)}He.Ta="serverreachability",b(Ge,C),He.STAT_EVENT="statevent",b(Ke,C),He.Ua="timingevent",b(Qe,C);var Xe={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},Je={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function Ze(){}function et(e){return e.h||(e.h=e.i())}function tt(){}Ze.prototype.h=null;var nt,rt={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function it(){C.call(this,"d")}function st(){C.call(this,"c")}function ot(){}function at(e,t,n,r){this.l=e,this.j=t,this.m=n,this.W=r||1,this.U=new Me(this),this.P=lt,e=F?125:void 0,this.V=new Pe(e),this.I=null,this.i=!1,this.u=this.B=this.A=this.L=this.G=this.Y=this.C=null,this.F=[],this.g=null,this.o=0,this.s=this.v=null,this.ca=-1,this.J=!1,this.O=0,this.M=null,this.ba=this.K=this.aa=this.S=!1,this.h=new ut}function ut(){this.i=null,this.g="",this.h=!1}b(it,C),b(st,C),b(ot,Ze),ot.prototype.g=function(){return new XMLHttpRequest},ot.prototype.i=function(){return{}},nt=new ot;var lt=45e3,ct={},ht={};function dt(e,t,n){e.L=1,e.A=Pt(It(t)),e.u=n,e.S=!0,ft(e,null)}function ft(e,t){e.G=Date.now(),yt(e),e.B=It(e.A);var n=e.B,r=e.W;Array.isArray(r)||(r=[String(r)]),qt(n.i,"t",r),e.o=0,n=e.l.J,e.h=new ut,e.g=Gn(e.l,n?t:null,!e.u),0<e.O&&(e.M=new Le(_(e.Pa,e,e.g),e.O)),je(e.U,e.g,"readystatechange",e.nb),t=e.I?Z(e.I):{},e.u?(e.v||(e.v="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ha(e.B,e.v,e.u,t)):(e.v="GET",e.g.ha(e.B,e.v,null,t)),$e(),function(e,t,n,r,i,s){e.info((function(){if(e.g)if(s)for(var o="",a=s.split("&"),u=0;u<a.length;u++){var l=a[u].split("=");if(1<l.length){var c=l[0];l=l[1];var h=c.split("_");o=2<=h.length&&"type"==h[1]?o+(c+"=")+l+"&":o+(c+"=redacted&")}}else o=null;else o=s;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.j,e.v,e.B,e.m,e.W,e.u)}function pt(e){return!!e.g&&("GET"==e.v&&2!=e.L&&e.l.Ha)}function mt(e,t,n){let r,i=!0;for(;!e.J&&e.o<n.length;){if(r=gt(e,n),r==ht){4==t&&(e.s=4,We(14),i=!1),Ve(e.j,e.m,null,"[Incomplete Response]");break}if(r==ct){e.s=4,We(15),Ve(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}Ve(e.j,e.m,r,null),Et(e,r)}pt(e)&&0!=e.o&&(e.h.g=e.h.g.slice(e.o),e.o=0),4!=t||0!=n.length||e.h.h||(e.s=1,We(16),i=!1),e.i=e.i&&i,i?0<n.length&&!e.ba&&(e.ba=!0,(t=e.l).g==e&&t.ca&&!t.M&&(t.l.info("Great, no buffering proxy detected. Bytes received: "+n.length),Fn(t),t.M=!0,We(11))):(Ve(e.j,e.m,n,"[Invalid Chunked Response]"),wt(e),bt(e))}function gt(e,t){var n=e.o,r=t.indexOf("\n",n);return-1==r?ht:(n=Number(t.substring(n,r)),isNaN(n)?ct:(r+=1)+n>t.length?ht:(t=t.slice(r,r+n),e.o=r+n,t))}function yt(e){e.Y=Date.now()+e.P,_t(e,e.P)}function _t(e,t){if(null!=e.C)throw Error("WatchDog timer not null");e.C=Ye(_(e.lb,e),t)}function vt(e){e.C&&(h.clearTimeout(e.C),e.C=null)}function bt(e){0==e.l.H||e.J||Bn(e.l,e)}function wt(e){vt(e);var t=e.M;t&&"function"==typeof t.sa&&t.sa(),e.M=null,xe(e.V),Ue(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function Et(e,t){try{var n=e.l;if(0!=n.H&&(n.g==e||Xt(n.i,e)))if(!e.K&&Xt(n.i,e)&&3==n.H){try{var r=n.Ja.g.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.u){if(n.g){if(!(n.g.G+3e3<e.G))break e;Un(n),Nn(n)}Mn(n),We(18)}}else n.Fa=i[1],0<n.Fa-n.V&&37500>i[2]&&n.G&&0==n.A&&!n.v&&(n.v=Ye(_(n.ib,n),6e3));if(1>=Yt(n.i)&&n.oa){try{n.oa()}catch(e){}n.oa=void 0}}else Hn(n,11)}else if((e.K||n.g==e)&&Un(n),!k(t))for(i=n.Ja.g.parse(t),t=0;t<i.length;t++){let l=i[t];if(n.V=l[0],l=l[1],2==n.H)if("c"==l[0]){n.K=l[1],n.pa=l[2];const t=l[3];null!=t&&(n.ra=t,n.l.info("VER="+n.ra));const i=l[4];null!=i&&(n.Ga=i,n.l.info("SVER="+n.Ga));const c=l[5];null!=c&&"number"==typeof c&&0<c&&(r=1.5*c,n.L=r,n.l.info("backChannelRequestTimeoutMs_="+r)),r=n;const h=e.g;if(h){const e=h.g?h.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=r.i;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(Jt(s,s.h),s.h=null))}if(r.F){const e=h.g?h.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.Da=e,Dt(r.I,r.F,e))}}n.H=3,n.h&&n.h.Ba(),n.ca&&(n.S=Date.now()-e.G,n.l.info("Handshake RTT: "+n.S+"ms"));var o=e;if((r=n).wa=qn(r,r.J?r.pa:null,r.Y),o.K){Zt(r.i,o);var a=o,u=r.L;u&&a.setTimeout(u),a.C&&(vt(a),yt(a)),r.g=o}else Ln(r);0<n.j.length&&Pn(n)}else"stop"!=l[0]&&"close"!=l[0]||Hn(n,7);else 3==n.H&&("stop"==l[0]||"close"==l[0]?"stop"==l[0]?Hn(n,7):An(n):"noop"!=l[0]&&n.h&&n.h.Aa(l),n.A=0)}$e()}catch(e){}}function St(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(d(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.ta&&"function"==typeof e.ta)return e.ta();if(!e.Z||"function"!=typeof e.Z){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(d(e)||"string"==typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const r in e)t[n++]=r;return t}}}(e),r=function(e){if(e.Z&&"function"==typeof e.Z)return e.Z();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");if(d(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length,s=0;s<i;s++)t.call(void 0,r[s],n&&n[s],e)}(r=at.prototype).setTimeout=function(e){this.P=e},r.nb=function(e){e=e.target;const t=this.M;t&&3==En(e)?t.l():this.Pa(e)},r.Pa=function(e){try{if(e==this.g)e:{const c=En(this.g);var t=this.g.Ia();this.g.da();if(!(3>c)&&(3!=c||F||this.g&&(this.h.h||this.g.ja()||Sn(this.g)))){this.J||4!=c||7==t||$e(),vt(this);var n=this.g.da();this.ca=n;t:if(pt(this)){var r=Sn(this.g);e="";var i=r.length,s=4==En(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){wt(this),bt(this);var o="";break t}this.h.i=new h.TextDecoder}for(t=0;t<i;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:s&&t==i-1});r.length=0,this.h.g+=e,this.o=0,o=this.h.g}else o=this.g.ja();if(this.i=200==n,function(e,t,n,r,i,s,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+s+" "+o}))}(this.j,this.v,this.B,this.m,this.W,c,n),this.i){if(this.aa&&!this.K){t:{if(this.g){var a,u=this.g;if((a=u.g?u.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!k(a)){var l=a;break t}}l=null}if(!(n=l)){this.i=!1,this.s=3,We(12),wt(this),bt(this);break e}Ve(this.j,this.m,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Et(this,n)}this.S?(mt(this,c,o),F&&this.i&&3==c&&(je(this.U,this.V,"tick",this.mb),this.V.start())):(Ve(this.j,this.m,o,null),Et(this,o)),4==c&&wt(this),this.i&&!this.J&&(4==c?Bn(this.l,this):(this.i=!1,yt(this)))}else(function(e){const t={};e=(e.g&&2<=En(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let r=0;r<e.length;r++){if(k(e[r]))continue;var n=Te(e[r]);const i=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const s=t[i]||[];t[i]=s,s.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,(function(e){return e.join(", ")}))})(this.g),400==n&&0<o.indexOf("Unknown SID")?(this.s=3,We(12)):(this.s=0,We(13)),wt(this),bt(this)}}}catch(e){}},r.mb=function(){if(this.g){var e=En(this.g),t=this.g.ja();this.o<t.length&&(vt(this),mt(this,e,t),this.i&&4!=e&&yt(this))}},r.cancel=function(){this.J=!0,wt(this)},r.lb=function(){this.C=null;const e=Date.now();0<=e-this.Y?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.j,this.B),2!=this.L&&($e(),We(17)),wt(this),this.s=2,bt(this)):_t(this,this.Y-e)};var Tt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Ct(e){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,e instanceof Ct){this.h=e.h,kt(this,e.j),this.s=e.s,this.g=e.g,At(this,e.m),this.l=e.l;var t=e.i,n=new Bt;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),Nt(this,n),this.o=e.o}else e&&(t=String(e).match(Tt))?(this.h=!1,kt(this,t[1]||"",!0),this.s=xt(t[2]||""),this.g=xt(t[3]||"",!0),At(this,t[4]),this.l=xt(t[5]||"",!0),Nt(this,t[6]||"",!0),this.o=xt(t[7]||"")):(this.h=!1,this.i=new Bt(null,this.h))}function It(e){return new Ct(e)}function kt(e,t,n){e.j=n?xt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function At(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function Nt(e,t,n){t instanceof Bt?(e.i=t,function(e,t){t&&!e.j&&(Vt(e),e.i=null,e.g.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Ht(this,t),qt(this,n,e))}),e)),e.j=t}(e.i,e.h)):(n||(t=Rt(t,jt)),e.i=new Bt(t,e.h))}function Dt(e,t,n){e.i.set(t,n)}function Pt(e){return Dt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function xt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Rt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,Ot),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Ot(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Ct.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Rt(t,Lt,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(Rt(t,Lt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(Rt(n,"/"==n.charAt(0)?Ft:Mt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.o)&&e.push("#",Rt(n,Ut)),e.join("")};var Lt=/[#\/\?@]/g,Mt=/[#\?:]/g,Ft=/[#\?]/g,jt=/[#\?@]/g,Ut=/#/g;function Bt(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Vt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var s=e[n].substring(0,r);i=e[n].substring(r+1)}else s=e[n];t(s,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Ht(e,t){Vt(e),t=Gt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function zt(e,t){return Vt(e),t=Gt(e,t),e.g.has(t)}function qt(e,t,n){Ht(e,t),0<n.length&&(e.i=null,e.g.set(Gt(e,t),S(n)),e.h+=n.length)}function Gt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(r=Bt.prototype).add=function(e,t){Vt(this),this.i=null,e=Gt(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},r.forEach=function(e,t){Vt(this),this.g.forEach((function(n,r){n.forEach((function(n){e.call(t,n,r,this)}),this)}),this)},r.ta=function(){Vt(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){const i=e[r];for(let e=0;e<i.length;e++)n.push(t[r])}return n},r.Z=function(e){Vt(this);let t=[];if("string"==typeof e)zt(this,e)&&(t=t.concat(this.g.get(Gt(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},r.set=function(e,t){return Vt(this),this.i=null,zt(this,e=Gt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},r.get=function(e,t){return e&&0<(e=this.Z(e)).length?String(e[0]):t},r.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];const s=encodeURIComponent(String(r)),o=this.Z(r);for(r=0;r<o.length;r++){var i=s;""!==o[r]&&(i+="="+encodeURIComponent(String(o[r]))),e.push(i)}}return this.i=e.join("&")};var $t=class{constructor(e,t){this.g=e,this.map=t}};function Kt(e){this.l=e||Wt,h.PerformanceNavigationTiming?e=0<(e=h.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(h.g&&h.g.Ka&&h.g.Ka()&&h.g.Ka().dc),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var Wt=10;function Qt(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Yt(e){return e.h?1:e.g?e.g.size:0}function Xt(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Jt(e,t){e.g?e.g.add(t):e.h=t}function Zt(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function en(e){if(null!=e.h)return e.i.concat(e.h.F);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.F);return t}return S(e.i)}Kt.prototype.cancel=function(){if(this.i=en(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var tn=class{stringify(e){return h.JSON.stringify(e,void 0)}parse(e){return h.JSON.parse(e,void 0)}};function nn(){this.g=new tn}function rn(e,t,n){const r=n||"";try{St(e,(function(e,n){let i=e;f(e)&&(i=be(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function sn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}function on(e){this.l=e.ec||null,this.j=e.ob||!1}function an(e,t){ye.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=un,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}b(on,Ze),on.prototype.g=function(){return new an(this.l,this.j)},on.prototype.i=function(e){return function(){return e}}({}),b(an,ye);var un=0;function ln(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}function cn(e){e.readyState=4,e.l=null,e.j=null,e.A=null,hn(e)}function hn(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(r=an.prototype).open=function(e,t){if(this.readyState!=un)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,hn(this)},r.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||h).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))},r.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch((()=>{})),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,cn(this)),this.readyState=un},r.$a=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,hn(this)),this.g&&(this.readyState=3,hn(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(void 0!==h.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;ln(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))},r.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?cn(this):hn(this),3==this.readyState&&ln(this)}},r.Za=function(e){this.g&&(this.response=this.responseText=e,cn(this))},r.Ya=function(e){this.g&&(this.response=e,cn(this))},r.ka=function(){this.g&&cn(this)},r.setRequestHeader=function(e,t){this.v.append(e,t)},r.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(an.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var dn=h.JSON.parse;function fn(e){ye.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=pn,this.L=this.M=!1}b(fn,ye);var pn="",mn=/^https?$/i,gn=["POST","PUT"];function yn(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,_n(e),bn(e)}function _n(e){e.F||(e.F=!0,_e(e,"complete"),_e(e,"error"))}function vn(e){if(e.h&&void 0!==c&&(!e.C[1]||4!=En(e)||2!=e.da()))if(e.v&&4==En(e))Re(e.La,0,e);else if(_e(e,"readystatechange"),4==En(e)){e.h=!1;try{const o=e.da();e:switch(o){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var r;if(r=0===o){var i=String(e.I).match(Tt)[1]||null;!i&&h.self&&h.self.location&&(i=h.self.location.protocol.slice(0,-1)),r=!mn.test(i?i.toLowerCase():"")}n=r}if(n)_e(e,"complete"),_e(e,"success");else{e.m=6;try{var s=2<En(e)?e.g.statusText:""}catch(e){s=""}e.j=s+" ["+e.da()+"]",_n(e)}}finally{bn(e)}}}function bn(e,t){if(e.g){wn(e);const n=e.g,r=e.C[0]?()=>{}:null;e.g=null,e.C=null,t||_e(e,"ready");try{n.onreadystatechange=r}catch(e){}}}function wn(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(h.clearTimeout(e.A),e.A=null)}function En(e){return e.g?e.g.readyState:0}function Sn(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.K){case pn:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function Tn(e){let t="";return J(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}function Cn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=Tn(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):Dt(e,t,n))}function In(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function kn(e){this.Ga=0,this.j=[],this.l=new Be,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=In("failFast",!1,e),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=In("baseRetryDelayMs",5e3,e),this.hb=In("retryDelaySeedMs",1e4,e),this.eb=In("forwardChannelMaxRetries",2,e),this.xa=In("forwardChannelRequestTimeoutMs",2e4,e),this.va=e&&e.xmlHttpFactory||void 0,this.Ha=e&&e.useFetchStreams||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.i=new Kt(e&&e.concurrentRequestLimit),this.Ja=new nn,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=e&&e.bc||!1,e&&e.Ea&&this.l.Ea(),e&&e.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&e&&e.detectBufferingProxy||!1,this.qa=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.qa=e.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}function An(e){if(Dn(e),3==e.H){var t=e.W++,n=It(e.I);if(Dt(n,"SID",e.K),Dt(n,"RID",t),Dt(n,"TYPE","terminate"),Rn(e,n),(t=new at(e,e.l,t)).L=2,t.A=Pt(It(n)),n=!1,h.navigator&&h.navigator.sendBeacon)try{n=h.navigator.sendBeacon(t.A.toString(),"")}catch(e){}!n&&h.Image&&((new Image).src=t.A,n=!0),n||(t.g=Gn(t.l,null),t.g.ha(t.A)),t.G=Date.now(),yt(t)}zn(e)}function Nn(e){e.g&&(Fn(e),e.g.cancel(),e.g=null)}function Dn(e){Nn(e),e.u&&(h.clearTimeout(e.u),e.u=null),Un(e),e.i.cancel(),e.m&&("number"==typeof e.m&&h.clearTimeout(e.m),e.m=null)}function Pn(e){if(!Qt(e.i)&&!e.m){e.m=!0;var t=e.Na;Ie||Ne(),ke||(Ie(),ke=!0),Ae.add(t,e),e.C=0}}function xn(e,t){var n;n=t?t.m:e.W++;const r=It(e.I);Dt(r,"SID",e.K),Dt(r,"RID",n),Dt(r,"AID",e.V),Rn(e,r),e.o&&e.s&&Cn(r,e.o,e.s),n=new at(e,e.l,n,e.C+1),null===e.o&&(n.I=e.s),t&&(e.j=t.F.concat(e.j)),t=On(e,n,1e3),n.setTimeout(Math.round(.5*e.xa)+Math.round(.5*e.xa*Math.random())),Jt(e.i,n),dt(n,r,t)}function Rn(e,t){e.na&&J(e.na,(function(e,n){Dt(t,n,e)})),e.h&&St({},(function(e,n){Dt(t,n,e)}))}function On(e,t,n){n=Math.min(e.j.length,n);var r=e.h?_(e.h.Va,e.h,e):null;e:{var i=e.j;let t=-1;for(;;){const e=["count="+n];-1==t?0<n?(t=i[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let s=!0;for(let o=0;o<n;o++){let n=i[o].g;const a=i[o].map;if(n-=t,0>n)t=Math.max(0,i[o].g-100),s=!1;else try{rn(a,e,"req"+n+"_")}catch(e){r&&r(a)}}if(s){r=e.join("&");break e}}}return e=e.j.splice(0,n),t.F=e,r}function Ln(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;Ie||Ne(),ke||(Ie(),ke=!0),Ae.add(t,e),e.A=0}}function Mn(e){return!(e.g||e.u||3<=e.A)&&(e.ba++,e.u=Ye(_(e.Ma,e),Vn(e,e.A)),e.A++,!0)}function Fn(e){null!=e.B&&(h.clearTimeout(e.B),e.B=null)}function jn(e){e.g=new at(e,e.l,"rpc",e.ba),null===e.o&&(e.g.I=e.s),e.g.O=0;var t=It(e.wa);Dt(t,"RID","rpc"),Dt(t,"SID",e.K),Dt(t,"AID",e.V),Dt(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&Dt(t,"TO",e.qa),Dt(t,"TYPE","xmlhttp"),Rn(e,t),e.o&&e.s&&Cn(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.A=Pt(It(t)),n.u=null,n.S=!0,ft(n,e)}function Un(e){null!=e.v&&(h.clearTimeout(e.v),e.v=null)}function Bn(e,t){var n=null;if(e.g==t){Un(e),Fn(e),e.g=null;var r=2}else{if(!Xt(e.i,t))return;n=t.F,Zt(e.i,t),r=1}if(0!=e.H)if(t.i)if(1==r){n=t.u?t.u.length:0,t=Date.now()-t.G;var i=e.C;_e(r=qe(),new Qe(r,n)),Pn(e)}else Ln(e);else if(3==(i=t.s)||0==i&&0<t.ca||!(1==r&&function(e,t){return!(Yt(e.i)>=e.i.j-(e.m?1:0)||(e.m?(e.j=t.F.concat(e.j),0):1==e.H||2==e.H||e.C>=(e.cb?0:e.eb)||(e.m=Ye(_(e.Na,e,t),Vn(e,e.C)),e.C++,0)))}(e,t)||2==r&&Mn(e)))switch(n&&0<n.length&&(t=e.i,t.i=t.i.concat(n)),i){case 1:Hn(e,5);break;case 4:Hn(e,10);break;case 3:Hn(e,6);break;default:Hn(e,2)}}function Vn(e,t){let n=e.ab+Math.floor(Math.random()*e.hb);return e.isActive()||(n*=2),n*t}function Hn(e,t){if(e.l.info("Error code "+t),2==t){var n=null;e.h&&(n=null);var r=_(e.pb,e);n||(n=new Ct("//www.google.com/images/cleardot.gif"),h.location&&"http"==h.location.protocol||kt(n,"https"),Pt(n)),function(e,t){const n=new Be;if(h.Image){const r=new Image;r.onload=v(sn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=v(sn,n,r,"TestLoadImage: error",!1,t),r.onabort=v(sn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=v(sn,n,r,"TestLoadImage: timeout",!1,t),h.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else We(2);e.H=0,e.h&&e.h.za(t),zn(e),Dn(e)}function zn(e){if(e.H=0,e.ma=[],e.h){const t=en(e.i);0==t.length&&0==e.j.length||(T(e.ma,t),T(e.ma,e.j),e.i.i.length=0,S(e.j),e.j.length=0),e.h.ya()}}function qn(e,t,n){var r=n instanceof Ct?It(n):new Ct(n);if(""!=r.g)t&&(r.g=t+"."+r.g),At(r,r.m);else{var i=h.location;r=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var s=new Ct(null);r&&kt(s,r),t&&(s.g=t),i&&At(s,i),n&&(s.l=n),r=s}return n=e.F,t=e.Da,n&&t&&Dt(r,n,t),Dt(r,"VER",e.ra),Rn(e,r),r}function Gn(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Ha&&!e.va?new fn(new on({ob:n})):new fn(e.va)).Oa(e.J),t}function $n(){}function Kn(){if(L&&!(10<=Number(G)))throw Error("Environmental error: no available transport.")}function Wn(e,t){ye.call(this),this.g=new kn(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.Ca&&(e?e["X-WebChannel-Client-Profile"]=t.Ca:e={"X-WebChannel-Client-Profile":t.Ca}),this.g.U=e,(e=t&&t.cc)&&!k(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!k(t)&&(this.g.F=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new Xn(this)}function Qn(e){it.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function Yn(){st.call(this),this.status=1}function Xn(e){this.g=e}function Jn(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}function Zn(e,t,n){n||(n=0);var r=Array(16);if("string"==typeof t)for(var i=0;16>i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var s=e.g[3],o=t+(s^n&(i^s))+r[0]+3614090360&4294967295;o=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=n+(o<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[1]+3905402710&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[2]+606105819&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[3]+3250441966&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[4]+4118548399&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[5]+1200080426&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[6]+2821735955&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[7]+4249261313&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[8]+1770035416&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[9]+2336552879&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[10]+4294925233&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[11]+2304563134&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[12]+1804603682&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[13]+4254626195&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[14]+2792965006&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[15]+1236535329&4294967295)<<22&4294967295|o>>>10))+((o=t+(i^s&(n^i))+r[1]+4129170786&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[6]+3225465664&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[11]+643717713&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[0]+3921069994&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[5]+3593408605&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[10]+38016083&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[15]+3634488961&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[4]+3889429448&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[9]+568446438&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[14]+3275163606&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[3]+4107603335&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[8]+1163531501&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[13]+2850285829&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[2]+4243563512&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[7]+1735328473&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[12]+2368359562&4294967295)<<20&4294967295|o>>>12))+((o=t+(n^i^s)+r[5]+4294588738&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[8]+2272392833&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[11]+1839030562&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[14]+4259657740&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[1]+2763975236&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[4]+1272893353&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[7]+4139469664&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[10]+3200236656&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[13]+681279174&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[0]+3936430074&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[3]+3572445317&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[6]+76029189&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[9]+3654602809&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[12]+3873151461&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[15]+530742520&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[2]+3299628645&4294967295)<<23&4294967295|o>>>9))+((o=t+(i^(n|~s))+r[0]+4096336452&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[7]+1126891415&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[14]+2878612391&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[5]+4237533241&4294967295)<<21&4294967295|o>>>11))+((o=t+(i^(n|~s))+r[12]+1700485571&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[3]+2399980690&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[10]+4293915773&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[1]+2240044497&4294967295)<<21&4294967295|o>>>11))+((o=t+(i^(n|~s))+r[8]+1873313359&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[15]+4264355552&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[6]+2734768916&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[13]+1309151649&4294967295)<<21&4294967295|o>>>11))+((s=(t=n+((o=t+(i^(n|~s))+r[4]+4149444226&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[11]+3174756917&4294967295)<<10&4294967295|o>>>22))^((i=s+((o=i+(t^(s|~n))+r[2]+718787259&4294967295)<<15&4294967295|o>>>17))|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}function er(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var s=0|e[i];r&&s==t||(n[i]=s,r=!1)}this.g=n}(r=fn.prototype).Oa=function(e){this.M=e},r.ha=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():nt.g(),this.C=this.u?et(this.u):et(nt),this.g.onreadystatechange=_(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(e){return void yn(this,e)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else{if("function"!=typeof r.keys||"function"!=typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(const e of r.keys())n.set(e,r.get(e))}r=Array.from(n.keys()).find((e=>"content-type"==e.toLowerCase())),i=h.FormData&&e instanceof h.FormData,!(0<=E(gn,t))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[e,t]of n)this.g.setRequestHeader(e,t);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{wn(this),0<this.B&&((this.L=function(e){return L&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=_(this.ua,this)):this.A=Re(this.ua,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(e){yn(this,e)}},r.ua=function(){void 0!==c&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,_e(this,"timeout"),this.abort(8))},r.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,_e(this,"complete"),_e(this,"abort"),bn(this))},r.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),bn(this,!0)),fn.$.N.call(this)},r.La=function(){this.s||(this.G||this.v||this.l?vn(this):this.kb())},r.kb=function(){vn(this)},r.isActive=function(){return!!this.g},r.da=function(){try{return 2<En(this)?this.g.status:-1}catch(e){return-1}},r.ja=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},r.Wa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),dn(t)}},r.Ia=function(){return this.m},r.Sa=function(){return"string"==typeof this.j?this.j:String(this.j)},(r=kn.prototype).ra=8,r.H=1,r.Na=function(e){if(this.m)if(this.m=null,1==this.H){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;const i=new at(this,this.l,e);let s=this.s;if(this.U&&(s?(s=Z(s),te(s,this.U)):s=this.U),null!==this.o||this.O||(i.I=s,s=null),this.P)e:{for(var t=0,n=0;n<this.j.length;n++){var r=this.j[n];if(void 0===(r="__data__"in r.map&&"string"==typeof(r=r.map.__data__)?r.length:void 0))break;if(4096<(t+=r)){t=n;break e}if(4096===t||n===this.j.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=On(this,i,t),Dt(n=It(this.I),"RID",e),Dt(n,"CVER",22),this.F&&Dt(n,"X-HTTP-Session-Id",this.F),Rn(this,n),s&&(this.O?t="headers="+encodeURIComponent(String(Tn(s)))+"&"+t:this.o&&Cn(n,this.o,s)),Jt(this.i,i),this.bb&&Dt(n,"TYPE","init"),this.P?(Dt(n,"$req",t),Dt(n,"SID","null"),i.aa=!0,dt(i,n,null)):dt(i,n,t),this.H=2}}else 3==this.H&&(e?xn(this,e):0==this.j.length||Qt(this.i)||xn(this))},r.Ma=function(){if(this.u=null,jn(this),this.ca&&!(this.M||null==this.g||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=Ye(_(this.jb,this),e)}},r.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,We(10),Nn(this),jn(this))},r.ib=function(){null!=this.v&&(this.v=null,Nn(this),Mn(this),We(19))},r.pb=function(e){e?(this.l.info("Successfully pinged google.com"),We(2)):(this.l.info("Failed to ping google.com"),We(1))},r.isActive=function(){return!!this.h&&this.h.isActive(this)},(r=$n.prototype).Ba=function(){},r.Aa=function(){},r.za=function(){},r.ya=function(){},r.isActive=function(){return!0},r.Va=function(){},Kn.prototype.g=function(e,t){return new Wn(e,t)},b(Wn,ye),Wn.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var e=this.g,t=this.l,n=this.h||void 0;We(0),e.Y=t,e.na=n||{},e.G=e.aa,e.I=qn(e,null,e.Y),Pn(e)},Wn.prototype.close=function(){An(this.g)},Wn.prototype.u=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=be(e),e=n);t.j.push(new $t(t.fb++,e)),3==t.H&&Pn(t)},Wn.prototype.N=function(){this.g.h=null,delete this.j,An(this.g),delete this.g,Wn.$.N.call(this)},b(Qn,it),b(Yn,st),b(Xn,$n),Xn.prototype.Ba=function(){_e(this.g,"a")},Xn.prototype.Aa=function(e){_e(this.g,new Qn(e))},Xn.prototype.za=function(e){_e(this.g,new Yn)},Xn.prototype.ya=function(){_e(this.g,"b")},b(Jn,(function(){this.blockSize=-1})),Jn.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0},Jn.prototype.j=function(e,t){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=this.m,i=this.h,s=0;s<t;){if(0==i)for(;s<=n;)Zn(this,e,s),s+=this.blockSize;if("string"==typeof e){for(;s<t;)if(r[i++]=e.charCodeAt(s++),i==this.blockSize){Zn(this,r),i=0;break}}else for(;s<t;)if(r[i++]=e[s++],i==this.blockSize){Zn(this,r),i=0;break}}this.h=i,this.i+=t},Jn.prototype.l=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.i;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.j(e),e=Array(16),t=n=0;4>t;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var tr={};function nr(e){return-128<=e&&128>e?function(e,t){var n=tr;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(e){return new er([0|e],0>e?-1:0)})):new er([0|e],0>e?-1:0)}function rr(e){if(isNaN(e)||!isFinite(e))return sr;if(0>e)return cr(rr(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=ir;return new er(t,0)}var ir=4294967296,sr=nr(0),or=nr(1),ar=nr(16777216);function ur(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function lr(e){return-1==e.h}function cr(e){for(var t=e.g.length,n=[],r=0;r<t;r++)n[r]=~e.g[r];return new er(n,~e.h).add(or)}function hr(e,t){return e.add(cr(t))}function dr(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function fr(e,t){this.g=e,this.h=t}function pr(e,t){if(ur(t))throw Error("division by zero");if(ur(e))return new fr(sr,sr);if(lr(e))return t=pr(cr(e),t),new fr(cr(t.g),cr(t.h));if(lr(t))return t=pr(e,cr(t)),new fr(cr(t.g),t.h);if(30<e.g.length){if(lr(e)||lr(t))throw Error("slowDivide_ only works with positive integers.");for(var n=or,r=t;0>=r.X(e);)n=mr(n),r=mr(r);var i=gr(n,1),s=gr(r,1);for(r=gr(r,2),n=gr(n,2);!ur(r);){var o=s.add(r);0>=o.X(e)&&(i=i.add(n),s=o),r=gr(r,1),n=gr(n,1)}return t=hr(e,i.R(t)),new fr(i,t)}for(i=sr;0<=e.X(t);){for(n=Math.max(1,Math.floor(e.ea()/t.ea())),r=48>=(r=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,r-48),o=(s=rr(n)).R(t);lr(o)||0<o.X(e);)o=(s=rr(n-=r)).R(t);ur(s)&&(s=or),i=i.add(s),e=hr(e,o)}return new fr(i,e)}function mr(e){for(var t=e.g.length+1,n=[],r=0;r<t;r++)n[r]=e.D(r)<<1|e.D(r-1)>>>31;return new er(n,e.h)}function gr(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s<r;s++)i[s]=0<t?e.D(s+n)>>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new er(i,e.h)}(r=er.prototype).ea=function(){if(lr(this))return-cr(this).ea();for(var e=0,t=1,n=0;n<this.g.length;n++){var r=this.D(n);e+=(0<=r?r:ir+r)*t,t*=ir}return e},r.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(ur(this))return"0";if(lr(this))return"-"+cr(this).toString(e);for(var t=rr(Math.pow(e,6)),n=this,r="";;){var i=pr(n,t).g,s=((0<(n=hr(n,i.R(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(ur(n=i))return s+r;for(;6>s.length;)s="0"+s;r=s+r}},r.D=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},r.X=function(e){return lr(e=hr(this,e))?-1:ur(e)?0:1},r.abs=function(){return lr(this)?cr(this):this},r.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0,i=0;i<=t;i++){var s=r+(65535&this.D(i))+(65535&e.D(i)),o=(s>>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);r=o>>>16,s&=65535,o&=65535,n[i]=o<<16|s}return new er(n,-2147483648&n[n.length-1]?-1:0)},r.R=function(e){if(ur(this)||ur(e))return sr;if(lr(this))return lr(e)?cr(this).R(cr(e)):cr(cr(this).R(e));if(lr(e))return cr(this.R(cr(e)));if(0>this.X(ar)&&0>e.X(ar))return rr(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(var i=0;i<e.g.length;i++){var s=this.D(r)>>>16,o=65535&this.D(r),a=e.D(i)>>>16,u=65535&e.D(i);n[2*r+2*i]+=o*u,dr(n,2*r+2*i),n[2*r+2*i+1]+=s*u,dr(n,2*r+2*i+1),n[2*r+2*i+1]+=o*a,dr(n,2*r+2*i+1),n[2*r+2*i+2]+=s*a,dr(n,2*r+2*i+2)}for(r=0;r<t;r++)n[r]=n[2*r+1]<<16|n[2*r];for(r=t;r<2*t;r++)n[r]=0;return new er(n,0)},r.gb=function(e){return pr(this,e).h},r.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)&e.D(r);return new er(n,this.h&e.h)},r.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)|e.D(r);return new er(n,this.h|e.h)},r.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)^e.D(r);return new er(n,this.h^e.h)},Kn.prototype.createWebChannel=Kn.prototype.g,Wn.prototype.send=Wn.prototype.u,Wn.prototype.open=Wn.prototype.m,Wn.prototype.close=Wn.prototype.close,Xe.NO_ERROR=0,Xe.TIMEOUT=8,Xe.HTTP_ERROR=6,Je.COMPLETE="complete",tt.EventType=rt,rt.OPEN="a",rt.CLOSE="b",rt.ERROR="c",rt.MESSAGE="d",ye.prototype.listen=ye.prototype.O,fn.prototype.listenOnce=fn.prototype.P,fn.prototype.getLastError=fn.prototype.Sa,fn.prototype.getLastErrorCode=fn.prototype.Ia,fn.prototype.getStatus=fn.prototype.da,fn.prototype.getResponseJson=fn.prototype.Wa,fn.prototype.getResponseText=fn.prototype.ja,fn.prototype.send=fn.prototype.ha,fn.prototype.setWithCredentials=fn.prototype.Oa,Jn.prototype.digest=Jn.prototype.l,Jn.prototype.reset=Jn.prototype.reset,Jn.prototype.update=Jn.prototype.j,er.prototype.add=er.prototype.add,er.prototype.multiply=er.prototype.R,er.prototype.modulo=er.prototype.gb,er.prototype.compare=er.prototype.X,er.prototype.toNumber=er.prototype.ea,er.prototype.toString=er.prototype.toString,er.prototype.getBits=er.prototype.D,er.fromNumber=rr,er.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);if("-"==t.charAt(0))return cr(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=rr(Math.pow(n,8)),i=sr,s=0;s<t.length;s+=8){var o=Math.min(8,t.length-s),a=parseInt(t.substring(s,s+o),n);8>o?(o=rr(Math.pow(n,o)),i=i.R(o).add(rr(a))):i=(i=i.R(r)).add(rr(a))}return i};var yr=l.createWebChannelTransport=function(){return new Kn},_r=l.getStatEventTarget=function(){return qe()},vr=l.ErrorCode=Xe,br=l.EventType=Je,wr=l.Event=He,Er=l.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},Sr=l.FetchXmlHttpFactory=on,Tr=l.WebChannel=tt,Cr=l.XhrIo=fn,Ir=l.Md5=Jn,kr=l.Integer=er;const Ar="@firebase/firestore";class Nr{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Nr.UNAUTHENTICATED=new Nr(null),Nr.GOOGLE_CREDENTIALS=new Nr("google-credentials-uid"),Nr.FIRST_PARTY=new Nr("first-party-uid"),Nr.MOCK_USER=new Nr("mock-user");let Dr="10.11.1";const Pr=new o.Vy("@firebase/firestore");function xr(){return Pr.logLevel}function Rr(e,...t){if(Pr.logLevel<=o.$b.DEBUG){const n=t.map(Mr);Pr.debug(`Firestore (${Dr}): ${e}`,...n)}}function Or(e,...t){if(Pr.logLevel<=o.$b.ERROR){const n=t.map(Mr);Pr.error(`Firestore (${Dr}): ${e}`,...n)}}function Lr(e,...t){if(Pr.logLevel<=o.$b.WARN){const n=t.map(Mr);Pr.warn(`Firestore (${Dr}): ${e}`,...n)}}function Mr(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function Fr(e="Unexpected state"){const t=`FIRESTORE (${Dr}) INTERNAL ASSERTION FAILED: `+e;throw Or(t),new Error(t)}function jr(e,t){e||Fr()}function Ur(e,t){return e}const Br={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Vr extends a.g{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class Hr{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}class zr{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class qr{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable((()=>t(Nr.UNAUTHENTICATED)))}shutdown(){}}class Gr{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(this.token.user)))}shutdown(){this.changeListener=null}}class $r{constructor(e){this.t=e,this.currentUser=Nr.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let n=this.i;const r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let i=new Hr;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new Hr,e.enqueueRetryable((()=>r(this.currentUser)))};const s=()=>{const t=i;e.enqueueRetryable((async()=>{await t.promise,await r(this.currentUser)}))},o=e=>{Rr("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit((e=>o(e))),setTimeout((()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?o(e):(Rr("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new Hr)}}),0),s()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then((t=>this.i!==e?(Rr("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(jr("string"==typeof t.accessToken),new zr(t.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return jr(null===e||"string"==typeof e),new Nr(e)}}class Kr{constructor(e,t,n){this.l=e,this.h=t,this.P=n,this.type="FirstParty",this.user=Nr.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class Wr{constructor(e,t,n){this.l=e,this.h=t,this.P=n}getToken(){return Promise.resolve(new Kr(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable((()=>t(Nr.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class Qr{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Yr{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){const n=e=>{null!=e.error&&Rr("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);const n=e.token!==this.R;return this.R=e.token,Rr("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable((()=>n(t)))};const r=e=>{Rr("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.A.onInit((e=>r(e))),setTimeout((()=>{if(!this.appCheck){const e=this.A.getImmediate({optional:!0});e?r(e):Rr("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((e=>e?(jr("string"==typeof e.token),this.R=e.token,new Qr(e.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}function Xr(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let t=0;t<e;t++)n[t]=Math.floor(256*Math.random());return n}class Jr{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(256/62);let n="";for(;n.length<20;){const r=Xr(40);for(let i=0;i<r.length;++i)n.length<20&&r[i]<t&&(n+=e.charAt(r[i]%62))}return n}}function Zr(e,t){return e<t?-1:e>t?1:0}function ei(e,t,n){return e.length===t.length&&e.every(((e,r)=>n(e,t[r])))}class ti{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Vr(Br.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Vr(Br.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new Vr(Br.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Vr(Br.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return ti.fromMillis(Date.now())}static fromDate(e){return ti.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new ti(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Zr(this.nanoseconds,e.nanoseconds):Zr(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class ni{constructor(e){this.timestamp=e}static fromTimestamp(e){return new ni(e)}static min(){return new ni(new ti(0,0))}static max(){return new ni(new ti(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class ri{constructor(e,t,n){void 0===t?t=0:t>e.length&&Fr(),void 0===n?n=e.length-t:n>e.length-t&&Fr(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===ri.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof ri?e.forEach((e=>{t.push(e)})):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=e.get(r),i=t.get(r);if(n<i)return-1;if(n>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class ii extends ri{construct(e,t,n){return new ii(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new Vr(Br.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter((e=>e.length>0)))}return new ii(t)}static emptyPath(){return new ii([])}}const si=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class oi extends ri{construct(e,t,n){return new oi(e,t,n)}static isValidIdentifier(e){return si.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),oi.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new oi(["__name__"])}static fromServerFormat(e){const t=[];let n="",r=0;const i=()=>{if(0===n.length)throw new Vr(Br.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let s=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new Vr(Br.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new Vr(Br.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?(s=!s,r++):"."!==t||s?(n+=t,r++):(i(),r++)}if(i(),s)throw new Vr(Br.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new oi(t)}static emptyPath(){return new oi([])}}class ai{constructor(e){this.path=e}static fromPath(e){return new ai(ii.fromString(e))}static fromName(e){return new ai(ii.fromString(e).popFirst(5))}static empty(){return new ai(ii.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===ii.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return ii.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ai(new ii(e.slice()))}}class ui{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}ui.UNKNOWN_ID=-1;function li(e,t){const n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,i=ni.fromTimestamp(1e9===r?new ti(n+1,0):new ti(n,r));return new hi(i,ai.empty(),t)}function ci(e){return new hi(e.readTime,e.key,-1)}class hi{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new hi(ni.min(),ai.empty(),-1)}static max(){return new hi(ni.max(),ai.empty(),-1)}}function di(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=ai.comparator(e.documentKey,t.documentKey),0!==n?n:Zr(e.largestBatchId,t.largestBatchId))}const fi="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class pi{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}async function mi(e){if(e.code!==Br.FAILED_PRECONDITION||e.message!==fi)throw e;Rr("LocalStore","Unexpectedly lost primary lease")}class gi{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)}),(e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Fr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new gi(((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof gi?t:gi.resolve(t)}catch(e){return gi.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):gi.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):gi.reject(t)}static resolve(e){return new gi(((t,n)=>{t(e)}))}static reject(e){return new gi(((t,n)=>{n(e)}))}static waitFor(e){return new gi(((t,n)=>{let r=0,i=0,s=!1;e.forEach((e=>{++r,e.next((()=>{++i,s&&i===r&&t()}),(e=>n(e)))})),s=!0,i===r&&t()}))}static or(e){let t=gi.resolve(!1);for(const n of e)t=t.next((e=>e?gi.resolve(e):n()));return t}static forEach(e,t){const n=[];return e.forEach(((e,r)=>{n.push(t.call(this,e,r))})),this.waitFor(n)}static mapArray(e,t){return new gi(((n,r)=>{const i=e.length,s=new Array(i);let o=0;for(let a=0;a<i;a++){const u=a;t(e[u]).next((e=>{s[u]=e,++o,o===i&&n(s)}),(e=>r(e)))}}))}static doWhile(e,t){return new gi(((n,r)=>{const i=()=>{!0===e()?t().next((()=>{i()}),r):n()};i()}))}}function yi(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function _i(e){return"IndexedDbTransactionError"===e.name}class vi{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ie(e),this.se=e=>t.writeSequenceNumber(e))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}function bi(e){return null==e}function wi(e){return 0===e&&1/e==-1/0}function Ei(e){return"number"==typeof e&&Number.isInteger(e)&&!wi(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}vi.oe=-1;const Si=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],Ti=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],Ci=Ti;function Ii(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ki(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function Ai(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class Ni{constructor(e,t){this.comparator=e,this.root=t||Pi.EMPTY}insert(e,t){return new Ni(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Pi.BLACK,null,null))}remove(e){return new Ni(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Pi.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((t,n)=>(e(t,n),!1)))}toString(){const e=[];return this.inorderTraversal(((t,n)=>(e.push(`${t}:${n}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Di(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Di(this.root,e,this.comparator,!1)}getReverseIterator(){return new Di(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Di(this.root,e,this.comparator,!0)}}class Di{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Pi{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:Pi.RED,this.left=null!=r?r:Pi.EMPTY,this.right=null!=i?i:Pi.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new Pi(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return Pi.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return Pi.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Pi.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Pi.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Fr();if(this.right.isRed())throw Fr();const e=this.left.check();if(e!==this.right.check())throw Fr();return e+(this.isRed()?0:1)}}Pi.EMPTY=null,Pi.RED=!0,Pi.BLACK=!1,Pi.EMPTY=new class{constructor(){this.size=0}get key(){throw Fr()}get value(){throw Fr()}get color(){throw Fr()}get left(){throw Fr()}get right(){throw Fr()}copy(e,t,n,r,i){return this}insert(e,t,n){return new Pi(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class xi{constructor(e){this.comparator=e,this.data=new Ni(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal(((t,n)=>(e(t),!1)))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new Ri(this.data.getIterator())}getIteratorFrom(e){return new Ri(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach((e=>{t=t.add(e)})),t}isEqual(e){if(!(e instanceof xi))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach((t=>{e.push(t)})),e}toString(){const e=[];return this.forEach((t=>e.push(t))),"SortedSet("+e.toString()+")"}copy(e){const t=new xi(this.comparator);return t.data=e,t}}class Ri{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class Oi{constructor(e){this.fields=e,e.sort(oi.comparator)}static empty(){return new Oi([])}unionWith(e){let t=new xi(oi.comparator);for(const e of this.fields)t=t.add(e);for(const n of e)t=t.add(n);return new Oi(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ei(this.fields,e.fields,((e,t)=>e.isEqual(t)))}}class Li extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Mi{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new Li("Invalid base64 string: "+e):e}}(e);return new Mi(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Mi(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Zr(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Mi.EMPTY_BYTE_STRING=new Mi("");const Fi=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function ji(e){if(jr(!!e),"string"==typeof e){let t=0;const n=Fi.exec(e);if(jr(!!n),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const r=new Date(e);return{seconds:Math.floor(r.getTime()/1e3),nanos:t}}return{seconds:Ui(e.seconds),nanos:Ui(e.nanos)}}function Ui(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function Bi(e){return"string"==typeof e?Mi.fromBase64String(e):Mi.fromUint8Array(e)}function Vi(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Hi(e){const t=e.mapValue.fields.__previous_value__;return Vi(t)?Hi(t):t}function zi(e){const t=ji(e.mapValue.fields.__local_write_time__.timestampValue);return new ti(t.seconds,t.nanos)}class qi{constructor(e,t,n,r,i,s,o,a,u){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=s,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=u}}class Gi{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new Gi("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof Gi&&e.projectId===this.projectId&&e.database===this.database}}const $i={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function Ki(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?Vi(e)?4:as(e)?9007199254740991:10:Fr()}function Wi(e,t){if(e===t)return!0;const n=Ki(e);if(n!==Ki(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return zi(e).isEqual(zi(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=ji(e.timestampValue),r=ji(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return Bi(e.bytesValue).isEqual(Bi(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Ui(e.geoPointValue.latitude)===Ui(t.geoPointValue.latitude)&&Ui(e.geoPointValue.longitude)===Ui(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Ui(e.integerValue)===Ui(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=Ui(e.doubleValue),r=Ui(t.doubleValue);return n===r?wi(n)===wi(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return ei(e.arrayValue.values||[],t.arrayValue.values||[],Wi);case 10:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(Ii(n)!==Ii(r))return!1;for(const e in n)if(n.hasOwnProperty(e)&&(void 0===r[e]||!Wi(n[e],r[e])))return!1;return!0}(e,t);default:return Fr()}}function Qi(e,t){return void 0!==(e.values||[]).find((e=>Wi(e,t)))}function Yi(e,t){if(e===t)return 0;const n=Ki(e),r=Ki(t);if(n!==r)return Zr(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Zr(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Ui(e.integerValue||e.doubleValue),r=Ui(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return Xi(e.timestampValue,t.timestampValue);case 4:return Xi(zi(e),zi(t));case 5:return Zr(e.stringValue,t.stringValue);case 6:return function(e,t){const n=Bi(e),r=Bi(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let e=0;e<n.length&&e<r.length;e++){const t=Zr(n[e],r[e]);if(0!==t)return t}return Zr(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=Zr(Ui(e.latitude),Ui(t.latitude));return 0!==n?n:Zr(Ui(e.longitude),Ui(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){const n=e.values||[],r=t.values||[];for(let e=0;e<n.length&&e<r.length;++e){const t=Yi(n[e],r[e]);if(t)return t}return Zr(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){if(e===$i.mapValue&&t===$i.mapValue)return 0;if(e===$i.mapValue)return 1;if(t===$i.mapValue)return-1;const n=e.fields||{},r=Object.keys(n),i=t.fields||{},s=Object.keys(i);r.sort(),s.sort();for(let e=0;e<r.length&&e<s.length;++e){const t=Zr(r[e],s[e]);if(0!==t)return t;const o=Yi(n[r[e]],i[s[e]]);if(0!==o)return o}return Zr(r.length,s.length)}(e.mapValue,t.mapValue);default:throw Fr()}}function Xi(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return Zr(e,t);const n=ji(e),r=ji(t),i=Zr(n.seconds,r.seconds);return 0!==i?i:Zr(n.nanos,r.nanos)}function Ji(e){return Zi(e)}function Zi(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=ji(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(e){return Bi(e).toBase64()}(e.bytesValue):"referenceValue"in e?function(e){return ai.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return`geo(${e.latitude},${e.longitude})`}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const r of e.values||[])n?n=!1:t+=",",t+=Zi(r);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",r=!0;for(const i of t)r?r=!1:n+=",",n+=`${i}:${Zi(e.fields[i])}`;return n+"}"}(e.mapValue):Fr()}function es(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function ts(e){return!!e&&"integerValue"in e}function ns(e){return!!e&&"arrayValue"in e}function rs(e){return!!e&&"nullValue"in e}function is(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function ss(e){return!!e&&"mapValue"in e}function os(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return ki(e.mapValue.fields,((e,n)=>t.mapValue.fields[e]=os(n))),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=os(e.arrayValue.values[n]);return t}return Object.assign({},e)}function as(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}class us{constructor(e){this.value=e}static empty(){return new us({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!ss(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=os(t)}setAll(e){let t=oi.emptyPath(),n={},r=[];e.forEach(((e,i)=>{if(!t.isImmediateParentOf(i)){const e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=i.popLast()}e?n[i.lastSegment()]=os(e):r.push(i.lastSegment())}));const i=this.getFieldsMap(t);this.applyChanges(i,n,r)}delete(e){const t=this.field(e.popLast());ss(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Wi(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];ss(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){ki(t,((t,n)=>e[t]=n));for(const t of n)delete e[t]}clone(){return new us(os(this.value))}}function ls(e){const t=[];return ki(e.fields,((e,n)=>{const r=new oi([e]);if(ss(n)){const e=ls(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)})),new Oi(t)}class cs{constructor(e,t,n,r,i,s,o){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=i,this.data=s,this.documentState=o}static newInvalidDocument(e){return new cs(e,0,ni.min(),ni.min(),ni.min(),us.empty(),0)}static newFoundDocument(e,t,n,r){return new cs(e,1,t,ni.min(),n,r,0)}static newNoDocument(e,t){return new cs(e,2,t,ni.min(),ni.min(),us.empty(),0)}static newUnknownDocument(e,t){return new cs(e,3,t,ni.min(),ni.min(),us.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(ni.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=us.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=us.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ni.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof cs&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new cs(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class hs{constructor(e,t){this.position=e,this.inclusive=t}}function ds(e,t,n){let r=0;for(let i=0;i<e.position.length;i++){const s=t[i],o=e.position[i];if(r=s.field.isKeyField()?ai.comparator(ai.fromName(o.referenceValue),n.key):Yi(o,n.data.field(s.field)),"desc"===s.dir&&(r*=-1),0!==r)break}return r}function fs(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!Wi(e.position[n],t.position[n]))return!1;return!0}class ps{constructor(e,t="asc"){this.field=e,this.dir=t}}function ms(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class gs{}class ys extends gs{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new Cs(e,t,n):"array-contains"===t?new Ns(e,n):"in"===t?new Ds(e,n):"not-in"===t?new Ps(e,n):"array-contains-any"===t?new xs(e,n):new ys(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new Is(e,n):new ks(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(Yi(t,this.value)):null!==t&&Ki(this.value)===Ki(t)&&this.matchesComparison(Yi(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return Fr()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class _s extends gs{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new _s(e,t)}matches(e){return vs(this)?void 0===this.filters.find((t=>!t.matches(e))):void 0!==this.filters.find((t=>t.matches(e)))}getFlattenedFilters(){return null!==this.ae||(this.ae=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function vs(e){return"and"===e.op}function bs(e){return ws(e)&&vs(e)}function ws(e){for(const t of e.filters)if(t instanceof _s)return!1;return!0}function Es(e){if(e instanceof ys)return e.field.canonicalString()+e.op.toString()+Ji(e.value);if(bs(e))return e.filters.map((e=>Es(e))).join(",");{const t=e.filters.map((e=>Es(e))).join(",");return`${e.op}(${t})`}}function Ss(e,t){return e instanceof ys?function(e,t){return t instanceof ys&&e.op===t.op&&e.field.isEqual(t.field)&&Wi(e.value,t.value)}(e,t):e instanceof _s?function(e,t){return t instanceof _s&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce(((e,n,r)=>e&&Ss(n,t.filters[r])),!0)}(e,t):void Fr()}function Ts(e){return e instanceof ys?function(e){return`${e.field.canonicalString()} ${e.op} ${Ji(e.value)}`}(e):e instanceof _s?function(e){return e.op.toString()+" {"+e.getFilters().map(Ts).join(" ,")+"}"}(e):"Filter"}class Cs extends ys{constructor(e,t,n){super(e,t,n),this.key=ai.fromName(n.referenceValue)}matches(e){const t=ai.comparator(e.key,this.key);return this.matchesComparison(t)}}class Is extends ys{constructor(e,t){super(e,"in",t),this.keys=As("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class ks extends ys{constructor(e,t){super(e,"not-in",t),this.keys=As("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function As(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((e=>ai.fromName(e.referenceValue)))}class Ns extends ys{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return ns(t)&&Qi(t.arrayValue,this.value)}}class Ds extends ys{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Qi(this.value.arrayValue,t)}}class Ps extends ys{constructor(e,t){super(e,"not-in",t)}matches(e){if(Qi(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!Qi(this.value.arrayValue,t)}}class xs extends ys{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!ns(t)||!t.arrayValue.values)&&t.arrayValue.values.some((e=>Qi(this.value.arrayValue,e)))}}class Rs{constructor(e,t=null,n=[],r=[],i=null,s=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=s,this.endAt=o,this.ue=null}}function Os(e,t=null,n=[],r=[],i=null,s=null,o=null){return new Rs(e,t,n,r,i,s,o)}function Ls(e){const t=Ur(e);if(null===t.ue){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map((e=>Es(e))).join(","),e+="|ob:",e+=t.orderBy.map((e=>function(e){return e.field.canonicalString()+e.dir}(e))).join(","),bi(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map((e=>Ji(e))).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map((e=>Ji(e))).join(",")),t.ue=e}return t.ue}function Ms(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!ms(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!Ss(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!fs(e.startAt,t.startAt)&&fs(e.endAt,t.endAt)}function Fs(e){return ai.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}class js{constructor(e,t=null,n=[],r=[],i=null,s="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=s,this.startAt=o,this.endAt=a,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function Us(e,t,n,r,i,s,o,a){return new js(e,t,n,r,i,s,o,a)}function Bs(e){return new js(e)}function Vs(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Hs(e){return null!==e.collectionGroup}function zs(e){const t=Ur(e);if(null===t.ce){t.ce=[];const e=new Set;for(const n of t.explicitOrderBy)t.ce.push(n),e.add(n.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",r=function(e){let t=new xi(oi.comparator);return e.filters.forEach((e=>{e.getFlattenedFilters().forEach((e=>{e.isInequality()&&(t=t.add(e.field))}))})),t}(t);r.forEach((r=>{e.has(r.canonicalString())||r.isKeyField()||t.ce.push(new ps(r,n))})),e.has(oi.keyField().canonicalString())||t.ce.push(new ps(oi.keyField(),n))}return t.ce}function qs(e){const t=Ur(e);return t.le||(t.le=Gs(t,zs(e))),t.le}function Gs(e,t){if("F"===e.limitType)return Os(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map((e=>{const t="desc"===e.dir?"asc":"desc";return new ps(e.field,t)}));const n=e.endAt?new hs(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new hs(e.startAt.position,e.startAt.inclusive):null;return Os(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function $s(e,t){const n=e.filters.concat([t]);return new js(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function Ks(e,t,n){return new js(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Ws(e,t){return Ms(qs(e),qs(t))&&e.limitType===t.limitType}function Qs(e){return`${Ls(qs(e))}|lt:${e.limitType}`}function Ys(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map((e=>Ts(e))).join(", ")}]`),bi(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map((e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e))).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((e=>Ji(e))).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((e=>Ji(e))).join(",")),`Target(${t})`}(qs(e))}; limitType=${e.limitType})`}function Xs(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):ai.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of zs(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const r=ds(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,zs(e),t))&&!(e.endAt&&!function(e,t,n){const r=ds(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,zs(e),t))}(e,t)}function Js(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function Zs(e){return(t,n)=>{let r=!1;for(const i of zs(e)){const e=eo(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}function eo(e,t,n){const r=e.field.isKeyField()?ai.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?Yi(r,i):Fr()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return Fr()}}class to{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[t,r]of n)if(this.equalsFn(t,e))return r}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return void(r[n]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){ki(this.inner,((t,n)=>{for(const[t,r]of n)e(t,r)}))}isEmpty(){return Ai(this.inner)}size(){return this.innerSize}}const no=new Ni(ai.comparator);function ro(){return no}const io=new Ni(ai.comparator);function so(...e){let t=io;for(const n of e)t=t.insert(n.key,n);return t}function oo(e){let t=io;return e.forEach(((e,n)=>t=t.insert(e,n.overlayedDocument))),t}function ao(){return lo()}function uo(){return lo()}function lo(){return new to((e=>e.toString()),((e,t)=>e.isEqual(t)))}const co=new Ni(ai.comparator),ho=new xi(ai.comparator);function fo(...e){let t=ho;for(const n of e)t=t.add(n);return t}const po=new xi(Zr);function mo(){return po}function go(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:wi(t)?"-0":t}}function yo(e){return{integerValue:""+e}}function _o(e,t){return Ei(t)?yo(t):go(e,t)}class vo{constructor(){this._=void 0}}function bo(e,t,n){return e instanceof So?function(e,t){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&Vi(t)&&(t=Hi(t)),t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof To?Co(e,t):e instanceof Io?ko(e,t):function(e,t){const n=Eo(e,t),r=No(n)+No(e.Pe);return ts(n)&&ts(e.Pe)?yo(r):go(e.serializer,r)}(e,t)}function wo(e,t,n){return e instanceof To?Co(e,t):e instanceof Io?ko(e,t):n}function Eo(e,t){return e instanceof Ao?function(e){return ts(e)||function(e){return!!e&&"doubleValue"in e}(e)}(t)?t:{integerValue:0}:null}class So extends vo{}class To extends vo{constructor(e){super(),this.elements=e}}function Co(e,t){const n=Do(t);for(const t of e.elements)n.some((e=>Wi(e,t)))||n.push(t);return{arrayValue:{values:n}}}class Io extends vo{constructor(e){super(),this.elements=e}}function ko(e,t){let n=Do(t);for(const t of e.elements)n=n.filter((e=>!Wi(e,t)));return{arrayValue:{values:n}}}class Ao extends vo{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function No(e){return Ui(e.integerValue||e.doubleValue)}function Do(e){return ns(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class Po{constructor(e,t){this.field=e,this.transform=t}}class xo{constructor(e,t){this.version=e,this.transformResults=t}}class Ro{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Ro}static exists(e){return new Ro(void 0,e)}static updateTime(e){return new Ro(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Oo(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Lo{}function Mo(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new $o(e.key,Ro.none()):new Vo(e.key,e.data,Ro.none());{const n=e.data,r=us.empty();let i=new xi(oi.comparator);for(let e of t.fields)if(!i.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),i=i.add(e)}return new Ho(e.key,r,new Oi(i.toArray()),Ro.none())}}function Fo(e,t,n){e instanceof Vo?function(e,t,n){const r=e.value.clone(),i=qo(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof Ho?function(e,t,n){if(!Oo(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=qo(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll(zo(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function jo(e,t,n,r){return e instanceof Vo?function(e,t,n,r){if(!Oo(e.precondition,t))return n;const i=e.value.clone(),s=Go(e.fieldTransforms,r,t);return i.setAll(s),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,n,r):e instanceof Ho?function(e,t,n,r){if(!Oo(e.precondition,t))return n;const i=Go(e.fieldTransforms,r,t),s=t.data;return s.setAll(zo(e)),s.setAll(i),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map((e=>e.field)))}(e,t,n,r):function(e,t,n){return Oo(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Uo(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),i=Eo(r.transform,e||null);null!=i&&(null===n&&(n=us.empty()),n.set(r.field,i))}return n||null}function Bo(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&ei(e,t,((e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof To&&t instanceof To||e instanceof Io&&t instanceof Io?ei(e.elements,t.elements,Wi):e instanceof Ao&&t instanceof Ao?Wi(e.Pe,t.Pe):e instanceof So&&t instanceof So}(e.transform,t.transform)}(e,t)))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class Vo extends Lo{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Ho extends Lo{constructor(e,t,n,r,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function zo(e){const t=new Map;return e.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}})),t}function qo(e,t,n){const r=new Map;jr(e.length===n.length);for(let i=0;i<n.length;i++){const s=e[i],o=s.transform,a=t.data.field(s.field);r.set(s.field,wo(o,a,n[i]))}return r}function Go(e,t,n){const r=new Map;for(const i of e){const e=i.transform,s=n.data.field(i.field);r.set(i.field,bo(e,s,t))}return r}class $o extends Lo{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Ko extends Lo{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Wo{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let t=0;t<this.mutations.length;t++){const r=this.mutations[t];r.key.isEqual(e.key)&&Fo(r,e,n[t])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=jo(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=jo(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=uo();return this.mutations.forEach((r=>{const i=e.get(r.key),s=i.overlayedDocument;let o=this.applyToLocalView(s,i.mutatedFields);o=t.has(r.key)?null:o;const a=Mo(s,o);null!==a&&n.set(r.key,a),s.isValidDocument()||s.convertToNoDocument(ni.min())})),n}keys(){return this.mutations.reduce(((e,t)=>e.add(t.key)),fo())}isEqual(e){return this.batchId===e.batchId&&ei(this.mutations,e.mutations,((e,t)=>Bo(e,t)))&&ei(this.baseMutations,e.baseMutations,((e,t)=>Bo(e,t)))}}class Qo{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){jr(e.mutations.length===n.length);let r=co;const i=e.mutations;for(let e=0;e<i.length;e++)r=r.insert(i[e].key,n[e].version);return new Qo(e,t,n,r)}}class Yo{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n      largestBatchId: ${this.largestBatchId},\n      mutation: ${this.mutation.toString()}\n    }`}}class Xo{constructor(e,t){this.count=e,this.unchangedNames=t}}var Jo,Zo;function ea(e){switch(e){default:return Fr();case Br.CANCELLED:case Br.UNKNOWN:case Br.DEADLINE_EXCEEDED:case Br.RESOURCE_EXHAUSTED:case Br.INTERNAL:case Br.UNAVAILABLE:case Br.UNAUTHENTICATED:return!1;case Br.INVALID_ARGUMENT:case Br.NOT_FOUND:case Br.ALREADY_EXISTS:case Br.PERMISSION_DENIED:case Br.FAILED_PRECONDITION:case Br.ABORTED:case Br.OUT_OF_RANGE:case Br.UNIMPLEMENTED:case Br.DATA_LOSS:return!0}}function ta(e){if(void 0===e)return Or("GRPC error has no .code"),Br.UNKNOWN;switch(e){case Jo.OK:return Br.OK;case Jo.CANCELLED:return Br.CANCELLED;case Jo.UNKNOWN:return Br.UNKNOWN;case Jo.DEADLINE_EXCEEDED:return Br.DEADLINE_EXCEEDED;case Jo.RESOURCE_EXHAUSTED:return Br.RESOURCE_EXHAUSTED;case Jo.INTERNAL:return Br.INTERNAL;case Jo.UNAVAILABLE:return Br.UNAVAILABLE;case Jo.UNAUTHENTICATED:return Br.UNAUTHENTICATED;case Jo.INVALID_ARGUMENT:return Br.INVALID_ARGUMENT;case Jo.NOT_FOUND:return Br.NOT_FOUND;case Jo.ALREADY_EXISTS:return Br.ALREADY_EXISTS;case Jo.PERMISSION_DENIED:return Br.PERMISSION_DENIED;case Jo.FAILED_PRECONDITION:return Br.FAILED_PRECONDITION;case Jo.ABORTED:return Br.ABORTED;case Jo.OUT_OF_RANGE:return Br.OUT_OF_RANGE;case Jo.UNIMPLEMENTED:return Br.UNIMPLEMENTED;case Jo.DATA_LOSS:return Br.DATA_LOSS;default:return Fr()}}(Zo=Jo||(Jo={}))[Zo.OK=0]="OK",Zo[Zo.CANCELLED=1]="CANCELLED",Zo[Zo.UNKNOWN=2]="UNKNOWN",Zo[Zo.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Zo[Zo.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Zo[Zo.NOT_FOUND=5]="NOT_FOUND",Zo[Zo.ALREADY_EXISTS=6]="ALREADY_EXISTS",Zo[Zo.PERMISSION_DENIED=7]="PERMISSION_DENIED",Zo[Zo.UNAUTHENTICATED=16]="UNAUTHENTICATED",Zo[Zo.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Zo[Zo.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Zo[Zo.ABORTED=10]="ABORTED",Zo[Zo.OUT_OF_RANGE=11]="OUT_OF_RANGE",Zo[Zo.UNIMPLEMENTED=12]="UNIMPLEMENTED",Zo[Zo.INTERNAL=13]="INTERNAL",Zo[Zo.UNAVAILABLE=14]="UNAVAILABLE",Zo[Zo.DATA_LOSS=15]="DATA_LOSS";let na=null;function ra(){return new TextEncoder}const ia=new kr([4294967295,4294967295],0);function sa(e){const t=ra().encode(e),n=new Ir;return n.update(t),new Uint8Array(n.digest())}function oa(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),r=t.getUint32(4,!0),i=t.getUint32(8,!0),s=t.getUint32(12,!0);return[new kr([n,r],0),new kr([i,s],0)]}class aa{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new ua(`Invalid padding: ${t}`);if(n<0)throw new ua(`Invalid hash count: ${n}`);if(e.length>0&&0===this.hashCount)throw new ua(`Invalid hash count: ${n}`);if(0===e.length&&0!==t)throw new ua(`Invalid padding when bitmap length is 0: ${t}`);this.Ie=8*e.length-t,this.Te=kr.fromNumber(this.Ie)}Ee(e,t,n){let r=e.add(t.multiply(kr.fromNumber(n)));return 1===r.compare(ia)&&(r=new kr([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Te).toNumber()}de(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.Ie)return!1;const t=sa(e),[n,r]=oa(t);for(let e=0;e<this.hashCount;e++){const t=this.Ee(n,r,e);if(!this.de(t))return!1}return!0}static create(e,t,n){const r=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),s=new aa(i,r,t);return n.forEach((e=>s.insert(e))),s}insert(e){if(0===this.Ie)return;const t=sa(e),[n,r]=oa(t);for(let e=0;e<this.hashCount;e++){const t=this.Ee(n,r,e);this.Ae(t)}}Ae(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class ua extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class la{constructor(e,t,n,r,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const r=new Map;return r.set(e,ca.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new la(ni.min(),r,new Ni(Zr),ro(),fo())}}class ca{constructor(e,t,n,r,i){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new ca(n,t,fo(),fo(),fo())}}class ha{constructor(e,t,n,r){this.Re=e,this.removedTargetIds=t,this.key=n,this.Ve=r}}class da{constructor(e,t){this.targetId=e,this.me=t}}class fa{constructor(e,t,n=Mi.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class pa{constructor(){this.fe=0,this.ge=ya(),this.pe=Mi.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return 0!==this.fe}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}Ce(){let e=fo(),t=fo(),n=fo();return this.ge.forEach(((r,i)=>{switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:Fr()}})),new ca(this.pe,this.ye,e,t,n)}ve(){this.we=!1,this.ge=ya()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,jr(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class ma{constructor(e){this.Le=e,this.Be=new Map,this.ke=ro(),this.qe=ga(),this.Qe=new Ni(Zr)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,(t=>{const n=this.Ge(t);switch(e.state){case 0:this.ze(t)&&n.De(e.resumeToken);break;case 1:n.Oe(),n.Se||n.ve(),n.De(e.resumeToken);break;case 2:n.Oe(),n.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(n.Ne(),n.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),n.De(e.resumeToken));break;default:Fr()}}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach(((e,n)=>{this.ze(n)&&t(n)}))}He(e){const t=e.targetId,n=e.me.count,r=this.Je(t);if(r){const i=r.target;if(Fs(i))if(0===n){const e=new ai(i.path);this.Ue(t,e,cs.newNoDocument(e,ni.min()))}else jr(1===n);else{const r=this.Ye(t);if(r!==n){const n=this.Ze(e),i=n?this.Xe(n,e,r):1;if(0!==i){this.je(t);const e=2===i?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,e)}null==na||na.et(function(e,t,n,r,i){var s,o,a,u,l,c;const h={localCacheCount:e,existenceFilterCount:t.count,databaseId:n.database,projectId:n.projectId},d=t.unchangedNames;return d&&(h.bloomFilter={applied:0===i,hashCount:null!==(s=null==d?void 0:d.hashCount)&&void 0!==s?s:0,bitmapLength:null!==(u=null===(a=null===(o=null==d?void 0:d.bits)||void 0===o?void 0:o.bitmap)||void 0===a?void 0:a.length)&&void 0!==u?u:0,padding:null!==(c=null===(l=null==d?void 0:d.bits)||void 0===l?void 0:l.padding)&&void 0!==c?c:0,mightContain:e=>{var t;return null!==(t=null==r?void 0:r.mightContain(e))&&void 0!==t&&t}}),h}(r,e.me,this.Le.tt(),n,i))}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:r=0},hashCount:i=0}=t;let s,o;try{s=Bi(n).toUint8Array()}catch(e){if(e instanceof Li)return Lr("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{o=new aa(s,r,i)}catch(e){return Lr(e instanceof ua?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===o.Ie?null:o}Xe(e,t,n){return t.me.count===n-this.nt(e,t.targetId)?0:2}nt(e,t){const n=this.Le.getRemoteKeysForTarget(t);let r=0;return n.forEach((n=>{const i=this.Le.tt(),s=`projects/${i.projectId}/databases/${i.database}/documents/${n.path.canonicalString()}`;e.mightContain(s)||(this.Ue(t,n,null),r++)})),r}rt(e){const t=new Map;this.Be.forEach(((n,r)=>{const i=this.Je(r);if(i){if(n.current&&Fs(i.target)){const t=new ai(i.target.path);null!==this.ke.get(t)||this.it(r,t)||this.Ue(r,t,cs.newNoDocument(t,e))}n.be&&(t.set(r,n.Ce()),n.ve())}}));let n=fo();this.qe.forEach(((e,t)=>{let r=!0;t.forEachWhile((e=>{const t=this.Je(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)})),r&&(n=n.add(e))})),this.ke.forEach(((t,n)=>n.setReadTime(e)));const r=new la(e,t,this.Qe,this.ke,n);return this.ke=ro(),this.qe=ga(),this.Qe=new Ni(Zr),r}$e(e,t){if(!this.ze(e))return;const n=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,n),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,n){if(!this.ze(e))return;const r=this.Ge(e);this.it(e,t)?r.Fe(t,1):r.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),n&&(this.ke=this.ke.insert(t,n))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).Ce();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new pa,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new xi(Zr),this.qe=this.qe.insert(e,t)),t}ze(e){const t=null!==this.Je(e);return t||Rr("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new pa),this.Le.getRemoteKeysForTarget(e).forEach((t=>{this.Ue(e,t,null)}))}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function ga(){return new Ni(ai.comparator)}function ya(){return new Ni(ai.comparator)}const _a={asc:"ASCENDING",desc:"DESCENDING"},va={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ba={and:"AND",or:"OR"};class wa{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Ea(e,t){return e.useProto3Json||bi(t)?t:{value:t}}function Sa(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function Ta(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function Ca(e,t){return Sa(e,t.toTimestamp())}function Ia(e){return jr(!!e),ni.fromTimestamp(function(e){const t=ji(e);return new ti(t.seconds,t.nanos)}(e))}function ka(e,t){return Aa(e,t).canonicalString()}function Aa(e,t){const n=function(e){return new ii(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?n:n.child(t)}function Na(e){const t=ii.fromString(e);return jr(Qa(t)),t}function Da(e,t){return ka(e.databaseId,t.path)}function Pa(e,t){const n=Na(t);if(n.get(1)!==e.databaseId.projectId)throw new Vr(Br.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new Vr(Br.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new ai(La(n))}function xa(e,t){return ka(e.databaseId,t)}function Ra(e){const t=Na(e);return 4===t.length?ii.emptyPath():La(t)}function Oa(e){return new ii(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function La(e){return jr(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function Ma(e,t,n){return{name:Da(e,t),fields:n.value.mapValue.fields}}function Fa(e,t){let n;if(t instanceof Vo)n={update:Ma(e,t.key,t.value)};else if(t instanceof $o)n={delete:Da(e,t.key)};else if(t instanceof Ho)n={update:Ma(e,t.key,t.data),updateMask:Wa(t.fieldMask)};else{if(!(t instanceof Ko))return Fr();n={verify:Da(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((e=>function(e,t){const n=t.transform;if(n instanceof So)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof To)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Io)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Ao)return{fieldPath:t.field.canonicalString(),increment:n.Pe};throw Fr()}(0,e)))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:Ca(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:Fr()}(e,t.precondition)),n}function ja(e,t){return{documents:[xa(e,t.path)]}}function Ua(e,t){const n={structuredQuery:{}},r=t.path;let i;null!==t.collectionGroup?(i=r,n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=xa(e,i);const s=function(e){if(0!==e.length)return Ka(_s.create(e,"and"))}(t.filters);s&&(n.structuredQuery.where=s);const o=function(e){if(0!==e.length)return e.map((e=>function(e){return{field:Ga(e.field),direction:Ha(e.dir)}}(e)))}(t.orderBy);o&&(n.structuredQuery.orderBy=o);const a=Ea(e,t.limit);return null!==a&&(n.structuredQuery.limit=a),t.startAt&&(n.structuredQuery.startAt=function(e){return{before:e.inclusive,values:e.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),{_t:n,parent:i}}function Ba(e){let t=Ra(e.parent);const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){jr(1===r);const e=n.from[0];e.allDescendants?i=e.collectionId:t=t.child(e.collectionId)}let s=[];n.where&&(s=function(e){const t=Va(e);return t instanceof _s&&bs(t)?t.getFilters():[t]}(n.where));let o=[];n.orderBy&&(o=function(e){return e.map((e=>function(e){return new ps($a(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e)))}(n.orderBy));let a=null;n.limit&&(a=function(e){let t;return t="object"==typeof e?e.value:e,bi(t)?null:t}(n.limit));let u=null;n.startAt&&(u=function(e){const t=!!e.before,n=e.values||[];return new hs(n,t)}(n.startAt));let l=null;return n.endAt&&(l=function(e){const t=!e.before,n=e.values||[];return new hs(n,t)}(n.endAt)),Us(t,i,o,s,a,"F",u,l)}function Va(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=$a(e.unaryFilter.field);return ys.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=$a(e.unaryFilter.field);return ys.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=$a(e.unaryFilter.field);return ys.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=$a(e.unaryFilter.field);return ys.create(i,"!=",{nullValue:"NULL_VALUE"});default:return Fr()}}(e):void 0!==e.fieldFilter?function(e){return ys.create($a(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return Fr()}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return _s.create(e.compositeFilter.filters.map((e=>Va(e))),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return Fr()}}(e.compositeFilter.op))}(e):Fr()}function Ha(e){return _a[e]}function za(e){return va[e]}function qa(e){return ba[e]}function Ga(e){return{fieldPath:e.canonicalString()}}function $a(e){return oi.fromServerFormat(e.fieldPath)}function Ka(e){return e instanceof ys?function(e){if("=="===e.op){if(is(e.value))return{unaryFilter:{field:Ga(e.field),op:"IS_NAN"}};if(rs(e.value))return{unaryFilter:{field:Ga(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(is(e.value))return{unaryFilter:{field:Ga(e.field),op:"IS_NOT_NAN"}};if(rs(e.value))return{unaryFilter:{field:Ga(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ga(e.field),op:za(e.op),value:e.value}}}(e):e instanceof _s?function(e){const t=e.getFilters().map((e=>Ka(e)));return 1===t.length?t[0]:{compositeFilter:{op:qa(e.op),filters:t}}}(e):Fr()}function Wa(e){const t=[];return e.fields.forEach((e=>t.push(e.canonicalString()))),{fieldPaths:t}}function Qa(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class Ya{constructor(e,t,n,r,i=ni.min(),s=ni.min(),o=Mi.EMPTY_BYTE_STRING,a=null){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=o,this.expectedCount=a}withSequenceNumber(e){return new Ya(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Ya(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ya(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ya(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class Xa{constructor(e){this.ut=e}}function Ja(e){const t=Ba({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Ks(t,t.limit,"L"):t}class Za{constructor(){}ht(e,t){this.Pt(e,t),t.It()}Pt(e,t){if("nullValue"in e)this.Tt(t,5);else if("booleanValue"in e)this.Tt(t,10),t.Et(e.booleanValue?1:0);else if("integerValue"in e)this.Tt(t,15),t.Et(Ui(e.integerValue));else if("doubleValue"in e){const n=Ui(e.doubleValue);isNaN(n)?this.Tt(t,13):(this.Tt(t,15),wi(n)?t.Et(0):t.Et(n))}else if("timestampValue"in e){let n=e.timestampValue;this.Tt(t,20),"string"==typeof n&&(n=ji(n)),t.dt(`${n.seconds||""}`),t.Et(n.nanos||0)}else if("stringValue"in e)this.At(e.stringValue,t),this.Rt(t);else if("bytesValue"in e)this.Tt(t,30),t.Vt(Bi(e.bytesValue)),this.Rt(t);else if("referenceValue"in e)this.ft(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.Tt(t,45),t.Et(n.latitude||0),t.Et(n.longitude||0)}else"mapValue"in e?as(e)?this.Tt(t,Number.MAX_SAFE_INTEGER):(this.gt(e.mapValue,t),this.Rt(t)):"arrayValue"in e?(this.yt(e.arrayValue,t),this.Rt(t)):Fr()}At(e,t){this.Tt(t,25),this.wt(e,t)}wt(e,t){t.dt(e)}gt(e,t){const n=e.fields||{};this.Tt(t,55);for(const e of Object.keys(n))this.At(e,t),this.Pt(n[e],t)}yt(e,t){const n=e.values||[];this.Tt(t,50);for(const e of n)this.Pt(e,t)}ft(e,t){this.Tt(t,37),ai.fromName(e).path.forEach((e=>{this.Tt(t,60),this.wt(e,t)}))}Tt(e,t){e.Et(t)}Rt(e){e.Et(2)}}Za.St=new Za;class eu{constructor(){this.on=new tu}addToCollectionParentIndex(e,t){return this.on.add(t),gi.resolve()}getCollectionParents(e,t){return gi.resolve(this.on.getEntries(t))}addFieldIndex(e,t){return gi.resolve()}deleteFieldIndex(e,t){return gi.resolve()}deleteAllFieldIndexes(e){return gi.resolve()}createTargetIndexes(e,t){return gi.resolve()}getDocumentsMatchingTarget(e,t){return gi.resolve(null)}getIndexType(e,t){return gi.resolve(0)}getFieldIndexes(e,t){return gi.resolve([])}getNextCollectionGroupToUpdate(e){return gi.resolve(null)}getMinOffset(e,t){return gi.resolve(hi.min())}getMinOffsetFromCollectionGroup(e,t){return gi.resolve(hi.min())}updateCollectionGroup(e,t,n){return gi.resolve()}updateIndexEntries(e,t){return gi.resolve()}}class tu{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new xi(ii.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new xi(ii.comparator)).toArray()}}new Uint8Array(0);class nu{constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}static withCacheSize(e){return new nu(e,nu.DEFAULT_COLLECTION_PERCENTILE,nu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}nu.DEFAULT_COLLECTION_PERCENTILE=10,nu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,nu.DEFAULT=new nu(41943040,nu.DEFAULT_COLLECTION_PERCENTILE,nu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),nu.DISABLED=new nu(-1,0,0);class ru{constructor(e){this.xn=e}next(){return this.xn+=2,this.xn}static On(){return new ru(0)}static Nn(){return new ru(-1)}}class iu{constructor(){this.changes=new to((e=>e.toString()),((e,t)=>e.isEqual(t))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,cs.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?gi.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class su{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class ou{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next((r=>(n=r,this.remoteDocumentCache.getEntry(e,t)))).next((e=>(null!==n&&jo(n.mutation,e,Oi.empty(),ti.now()),e)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((t=>this.getLocalViewOfDocuments(e,t,fo()).next((()=>t))))}getLocalViewOfDocuments(e,t,n=fo()){const r=ao();return this.populateOverlays(e,r,t).next((()=>this.computeViews(e,t,r,n).next((e=>{let t=so();return e.forEach(((e,n)=>{t=t.insert(e,n.overlayedDocument)})),t}))))}getOverlayedDocuments(e,t){const n=ao();return this.populateOverlays(e,n,t).next((()=>this.computeViews(e,t,n,fo())))}populateOverlays(e,t,n){const r=[];return n.forEach((e=>{t.has(e)||r.push(e)})),this.documentOverlayCache.getOverlays(e,r).next((e=>{e.forEach(((e,n)=>{t.set(e,n)}))}))}computeViews(e,t,n,r){let i=ro();const s=lo(),o=lo();return t.forEach(((e,t)=>{const o=n.get(t.key);r.has(t.key)&&(void 0===o||o.mutation instanceof Ho)?i=i.insert(t.key,t):void 0!==o?(s.set(t.key,o.mutation.getFieldMask()),jo(o.mutation,t,o.mutation.getFieldMask(),ti.now())):s.set(t.key,Oi.empty())})),this.recalculateAndSaveOverlays(e,i).next((e=>(e.forEach(((e,t)=>s.set(e,t))),t.forEach(((e,t)=>{var n;return o.set(e,new su(t,null!==(n=s.get(e))&&void 0!==n?n:null))})),o)))}recalculateAndSaveOverlays(e,t){const n=lo();let r=new Ni(((e,t)=>e-t)),i=fo();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((e=>{for(const i of e)i.keys().forEach((e=>{const s=t.get(e);if(null===s)return;let o=n.get(e)||Oi.empty();o=i.applyToLocalView(s,o),n.set(e,o);const a=(r.get(i.batchId)||fo()).add(e);r=r.insert(i.batchId,a)}))})).next((()=>{const s=[],o=r.getReverseIterator();for(;o.hasNext();){const r=o.getNext(),a=r.key,u=r.value,l=uo();u.forEach((e=>{if(!i.has(e)){const r=Mo(t.get(e),n.get(e));null!==r&&l.set(e,r),i=i.add(e)}})),s.push(this.documentOverlayCache.saveOverlays(e,a,l))}return gi.waitFor(s)})).next((()=>n))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((t=>this.recalculateAndSaveOverlays(e,t)))}getDocumentsMatchingQuery(e,t,n,r){return function(e){return ai.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):Hs(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,r):this.getDocumentsMatchingCollectionQuery(e,t,n,r)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next((i=>{const s=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-i.size):gi.resolve(ao());let o=-1,a=i;return s.next((t=>gi.forEach(t,((t,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),i.get(t)?gi.resolve():this.remoteDocumentCache.getEntry(e,t).next((e=>{a=a.insert(t,e)}))))).next((()=>this.populateOverlays(e,t,i))).next((()=>this.computeViews(e,a,t,fo()))).next((e=>({batchId:o,changes:oo(e)})))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ai(t)).next((e=>{let t=so();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t}))}getDocumentsMatchingCollectionGroupQuery(e,t,n,r){const i=t.collectionGroup;let s=so();return this.indexManager.getCollectionParents(e,i).next((o=>gi.forEach(o,(o=>{const a=function(e,t){return new js(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,o.child(i));return this.getDocumentsMatchingCollectionQuery(e,a,n,r).next((e=>{e.forEach(((e,t)=>{s=s.insert(e,t)}))}))})).next((()=>s))))}getDocumentsMatchingCollectionQuery(e,t,n,r){let i;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next((s=>(i=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,i,r)))).next((e=>{i.forEach(((t,n)=>{const r=n.getKey();null===e.get(r)&&(e=e.insert(r,cs.newInvalidDocument(r)))}));let n=so();return e.forEach(((e,r)=>{const s=i.get(e);void 0!==s&&jo(s.mutation,r,Oi.empty(),ti.now()),Xs(t,r)&&(n=n.insert(e,r))})),n}))}}class au{constructor(e){this.serializer=e,this.ur=new Map,this.cr=new Map}getBundleMetadata(e,t){return gi.resolve(this.ur.get(t))}saveBundleMetadata(e,t){return this.ur.set(t.id,function(e){return{id:e.id,version:e.version,createTime:Ia(e.createTime)}}(t)),gi.resolve()}getNamedQuery(e,t){return gi.resolve(this.cr.get(t))}saveNamedQuery(e,t){return this.cr.set(t.name,function(e){return{name:e.name,query:Ja(e.bundledQuery),readTime:Ia(e.readTime)}}(t)),gi.resolve()}}class uu{constructor(){this.overlays=new Ni(ai.comparator),this.lr=new Map}getOverlay(e,t){return gi.resolve(this.overlays.get(t))}getOverlays(e,t){const n=ao();return gi.forEach(t,(t=>this.getOverlay(e,t).next((e=>{null!==e&&n.set(t,e)})))).next((()=>n))}saveOverlays(e,t,n){return n.forEach(((n,r)=>{this.lt(e,t,r)})),gi.resolve()}removeOverlaysForBatchId(e,t,n){const r=this.lr.get(n);return void 0!==r&&(r.forEach((e=>this.overlays=this.overlays.remove(e))),this.lr.delete(n)),gi.resolve()}getOverlaysForCollection(e,t,n){const r=ao(),i=t.length+1,s=new ai(t.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){const e=o.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&e.largestBatchId>n&&r.set(e.getKey(),e)}return gi.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let i=new Ni(((e,t)=>e-t));const s=this.overlays.getIterator();for(;s.hasNext();){const e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=i.get(e.largestBatchId);null===t&&(t=ao(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const o=ao(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach(((e,t)=>o.set(e,t))),!(o.size()>=r)););return gi.resolve(o)}lt(e,t,n){const r=this.overlays.get(n.key);if(null!==r){const e=this.lr.get(r.largestBatchId).delete(n.key);this.lr.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Yo(t,n));let i=this.lr.get(t);void 0===i&&(i=fo(),this.lr.set(t,i)),this.lr.set(t,i.add(n.key))}}class lu{constructor(){this.hr=new xi(cu.Pr),this.Ir=new xi(cu.Tr)}isEmpty(){return this.hr.isEmpty()}addReference(e,t){const n=new cu(e,t);this.hr=this.hr.add(n),this.Ir=this.Ir.add(n)}Er(e,t){e.forEach((e=>this.addReference(e,t)))}removeReference(e,t){this.dr(new cu(e,t))}Ar(e,t){e.forEach((e=>this.removeReference(e,t)))}Rr(e){const t=new ai(new ii([])),n=new cu(t,e),r=new cu(t,e+1),i=[];return this.Ir.forEachInRange([n,r],(e=>{this.dr(e),i.push(e.key)})),i}Vr(){this.hr.forEach((e=>this.dr(e)))}dr(e){this.hr=this.hr.delete(e),this.Ir=this.Ir.delete(e)}mr(e){const t=new ai(new ii([])),n=new cu(t,e),r=new cu(t,e+1);let i=fo();return this.Ir.forEachInRange([n,r],(e=>{i=i.add(e.key)})),i}containsKey(e){const t=new cu(e,0),n=this.hr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class cu{constructor(e,t){this.key=e,this.gr=t}static Pr(e,t){return ai.comparator(e.key,t.key)||Zr(e.gr,t.gr)}static Tr(e,t){return Zr(e.gr,t.gr)||ai.comparator(e.key,t.key)}}class hu{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.pr=1,this.yr=new xi(cu.Pr)}checkEmpty(e){return gi.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){const i=this.pr;this.pr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new Wo(i,t,n,r);this.mutationQueue.push(s);for(const t of r)this.yr=this.yr.add(new cu(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return gi.resolve(s)}lookupMutationBatch(e,t){return gi.resolve(this.wr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.Sr(n),i=r<0?0:r;return gi.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return gi.resolve(0===this.mutationQueue.length?-1:this.pr-1)}getAllMutationBatches(e){return gi.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new cu(t,0),r=new cu(t,Number.POSITIVE_INFINITY),i=[];return this.yr.forEachInRange([n,r],(e=>{const t=this.wr(e.gr);i.push(t)})),gi.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new xi(Zr);return t.forEach((e=>{const t=new cu(e,0),r=new cu(e,Number.POSITIVE_INFINITY);this.yr.forEachInRange([t,r],(e=>{n=n.add(e.gr)}))})),gi.resolve(this.br(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let i=n;ai.isDocumentKey(i)||(i=i.child(""));const s=new cu(new ai(i),0);let o=new xi(Zr);return this.yr.forEachWhile((e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(o=o.add(e.gr)),!0)}),s),gi.resolve(this.br(o))}br(e){const t=[];return e.forEach((e=>{const n=this.wr(e);null!==n&&t.push(n)})),t}removeMutationBatch(e,t){jr(0===this.Dr(t.batchId,"removed")),this.mutationQueue.shift();let n=this.yr;return gi.forEach(t.mutations,(r=>{const i=new cu(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)})).next((()=>{this.yr=n}))}Fn(e){}containsKey(e,t){const n=new cu(t,0),r=this.yr.firstAfterOrEqual(n);return gi.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,gi.resolve()}Dr(e,t){return this.Sr(e)}Sr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}wr(e){const t=this.Sr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class du{constructor(e){this.Cr=e,this.docs=new Ni(ai.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,r=this.docs.get(n),i=r?r.size:0,s=this.Cr(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:s}),this.size+=s-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return gi.resolve(n?n.document.mutableCopy():cs.newInvalidDocument(t))}getEntries(e,t){let n=ro();return t.forEach((e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():cs.newInvalidDocument(e))})),gi.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let i=ro();const s=t.path,o=new ai(s.child("")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){const{key:e,value:{document:o}}=a.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||di(ci(o),n)<=0||(r.has(o.key)||Xs(t,o))&&(i=i.insert(o.key,o.mutableCopy()))}return gi.resolve(i)}getAllFromCollectionGroup(e,t,n,r){Fr()}vr(e,t){return gi.forEach(this.docs,(e=>t(e)))}newChangeBuffer(e){return new fu(this)}getSize(e){return gi.resolve(this.size)}}class fu extends iu{constructor(e){super(),this._r=e}applyChanges(e){const t=[];return this.changes.forEach(((n,r)=>{r.isValidDocument()?t.push(this._r.addEntry(e,r)):this._r.removeEntry(n)})),gi.waitFor(t)}getFromCache(e,t){return this._r.getEntry(e,t)}getAllFromCache(e,t){return this._r.getEntries(e,t)}}class pu{constructor(e){this.persistence=e,this.Fr=new to((e=>Ls(e)),Ms),this.lastRemoteSnapshotVersion=ni.min(),this.highestTargetId=0,this.Mr=0,this.Or=new lu,this.targetCount=0,this.Nr=ru.On()}forEachTarget(e,t){return this.Fr.forEach(((e,n)=>t(n))),gi.resolve()}getLastRemoteSnapshotVersion(e){return gi.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return gi.resolve(this.Mr)}allocateTargetId(e){return this.highestTargetId=this.Nr.next(),gi.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Mr&&(this.Mr=t),gi.resolve()}kn(e){this.Fr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Nr=new ru(t),this.highestTargetId=t),e.sequenceNumber>this.Mr&&(this.Mr=e.sequenceNumber)}addTargetData(e,t){return this.kn(t),this.targetCount+=1,gi.resolve()}updateTargetData(e,t){return this.kn(t),gi.resolve()}removeTargetData(e,t){return this.Fr.delete(t.target),this.Or.Rr(t.targetId),this.targetCount-=1,gi.resolve()}removeTargets(e,t,n){let r=0;const i=[];return this.Fr.forEach(((s,o)=>{o.sequenceNumber<=t&&null===n.get(o.targetId)&&(this.Fr.delete(s),i.push(this.removeMatchingKeysForTargetId(e,o.targetId)),r++)})),gi.waitFor(i).next((()=>r))}getTargetCount(e){return gi.resolve(this.targetCount)}getTargetData(e,t){const n=this.Fr.get(t)||null;return gi.resolve(n)}addMatchingKeys(e,t,n){return this.Or.Er(t,n),gi.resolve()}removeMatchingKeys(e,t,n){this.Or.Ar(t,n);const r=this.persistence.referenceDelegate,i=[];return r&&t.forEach((t=>{i.push(r.markPotentiallyOrphaned(e,t))})),gi.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.Or.Rr(t),gi.resolve()}getMatchingKeysForTargetId(e,t){const n=this.Or.mr(t);return gi.resolve(n)}containsKey(e,t){return gi.resolve(this.Or.containsKey(t))}}class mu{constructor(e,t){this.Lr={},this.overlays={},this.Br=new vi(0),this.kr=!1,this.kr=!0,this.referenceDelegate=e(this),this.qr=new pu(this),this.indexManager=new eu,this.remoteDocumentCache=function(e){return new du(e)}((e=>this.referenceDelegate.Qr(e))),this.serializer=new Xa(t),this.Kr=new au(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.kr=!1,Promise.resolve()}get started(){return this.kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new uu,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.Lr[e.toKey()];return n||(n=new hu(t,this.referenceDelegate),this.Lr[e.toKey()]=n),n}getTargetCache(){return this.qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Kr}runTransaction(e,t,n){Rr("MemoryPersistence","Starting transaction:",e);const r=new gu(this.Br.next());return this.referenceDelegate.$r(),n(r).next((e=>this.referenceDelegate.Ur(r).next((()=>e)))).toPromise().then((e=>(r.raiseOnCommittedEvent(),e)))}Wr(e,t){return gi.or(Object.values(this.Lr).map((n=>()=>n.containsKey(e,t))))}}class gu extends pi{constructor(e){super(),this.currentSequenceNumber=e}}class yu{constructor(e){this.persistence=e,this.Gr=new lu,this.zr=null}static jr(e){return new yu(e)}get Hr(){if(this.zr)return this.zr;throw Fr()}addReference(e,t,n){return this.Gr.addReference(n,t),this.Hr.delete(n.toString()),gi.resolve()}removeReference(e,t,n){return this.Gr.removeReference(n,t),this.Hr.add(n.toString()),gi.resolve()}markPotentiallyOrphaned(e,t){return this.Hr.add(t.toString()),gi.resolve()}removeTarget(e,t){this.Gr.Rr(t.targetId).forEach((e=>this.Hr.add(e.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next((e=>{e.forEach((e=>this.Hr.add(e.toString())))})).next((()=>n.removeTargetData(e,t)))}$r(){this.zr=new Set}Ur(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return gi.forEach(this.Hr,(n=>{const r=ai.fromPath(n);return this.Jr(e,r).next((e=>{e||t.removeEntry(r,ni.min())}))})).next((()=>(this.zr=null,t.apply(e))))}updateLimboDocument(e,t){return this.Jr(e,t).next((e=>{e?this.Hr.delete(t.toString()):this.Hr.add(t.toString())}))}Qr(e){return 0}Jr(e,t){return gi.or([()=>gi.resolve(this.Gr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Wr(e,t)])}}class _u{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.ki=n,this.qi=r}static Qi(e,t){let n=fo(),r=fo();for(const e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:r=r.add(e.doc.key)}return new _u(e,t.fromCache,n,r)}}class vu{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class bu{constructor(){this.Ki=!1,this.$i=!1,this.Ui=100,this.Wi=(0,a.nr)()?8:yi((0,a.ZQ)())>0?6:4}initialize(e,t){this.Gi=e,this.indexManager=t,this.Ki=!0}getDocumentsMatchingQuery(e,t,n,r){const i={result:null};return this.zi(e,t).next((e=>{i.result=e})).next((()=>{if(!i.result)return this.ji(e,t,r,n).next((e=>{i.result=e}))})).next((()=>{if(i.result)return;const n=new vu;return this.Hi(e,t,n).next((r=>{if(i.result=r,this.$i)return this.Ji(e,t,n,r.size)}))})).next((()=>i.result))}Ji(e,t,n,r){return n.documentReadCount<this.Ui?(xr()<=o.$b.DEBUG&&Rr("QueryEngine","SDK will not create cache indexes for query:",Ys(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Ui,"documents"),gi.resolve()):(xr()<=o.$b.DEBUG&&Rr("QueryEngine","Query:",Ys(t),"scans",n.documentReadCount,"local documents and returns",r,"documents as results."),n.documentReadCount>this.Wi*r?(xr()<=o.$b.DEBUG&&Rr("QueryEngine","The SDK decides to create cache indexes for query:",Ys(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,qs(t))):gi.resolve())}zi(e,t){if(Vs(t))return gi.resolve(null);let n=qs(t);return this.indexManager.getIndexType(e,n).next((r=>0===r?null:(null!==t.limit&&1===r&&(t=Ks(t,null,"F"),n=qs(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next((r=>{const i=fo(...r);return this.Gi.getDocuments(e,i).next((r=>this.indexManager.getMinOffset(e,n).next((n=>{const s=this.Yi(t,r);return this.Zi(t,s,i,n.readTime)?this.zi(e,Ks(t,null,"F")):this.Xi(e,s,t,n)}))))})))))}ji(e,t,n,r){return Vs(t)||r.isEqual(ni.min())?gi.resolve(null):this.Gi.getDocuments(e,n).next((i=>{const s=this.Yi(t,i);return this.Zi(t,s,n,r)?gi.resolve(null):(xr()<=o.$b.DEBUG&&Rr("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),Ys(t)),this.Xi(e,s,t,li(r,-1)).next((e=>e)))}))}Yi(e,t){let n=new xi(Zs(e));return t.forEach(((t,r)=>{Xs(e,r)&&(n=n.add(r))})),n}Zi(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Hi(e,t,n){return xr()<=o.$b.DEBUG&&Rr("QueryEngine","Using full collection scan to execute query:",Ys(t)),this.Gi.getDocumentsMatchingQuery(e,t,hi.min(),n)}Xi(e,t,n,r){return this.Gi.getDocumentsMatchingQuery(e,n,r).next((e=>(t.forEach((t=>{e=e.insert(t.key,t)})),e)))}}class wu{constructor(e,t,n,r){this.persistence=e,this.es=t,this.serializer=r,this.ts=new Ni(Zr),this.ns=new to((e=>Ls(e)),Ms),this.rs=new Map,this.ss=e.getRemoteDocumentCache(),this.qr=e.getTargetCache(),this.Kr=e.getBundleCache(),this.os(n)}os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new ou(this.ss,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ss.setIndexManager(this.indexManager),this.es.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.ts)))}}function Eu(e,t,n,r){return new wu(e,t,n,r)}async function Su(e,t){const n=Ur(e);return await n.persistence.runTransaction("Handle user change","readonly",(e=>{let r;return n.mutationQueue.getAllMutationBatches(e).next((i=>(r=i,n.os(t),n.mutationQueue.getAllMutationBatches(e)))).next((t=>{const i=[],s=[];let o=fo();for(const e of r){i.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}for(const e of t){s.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}return n.localDocuments.getDocuments(e,o).next((e=>({_s:e,removedBatchIds:i,addedBatchIds:s})))}))}))}function Tu(e){const t=Ur(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(e=>t.qr.getLastRemoteSnapshotVersion(e)))}function Cu(e,t,n){let r=fo(),i=fo();return n.forEach((e=>r=r.add(e))),t.getEntries(e,r).next((e=>{let r=ro();return n.forEach(((n,s)=>{const o=e.get(n);s.isFoundDocument()!==o.isFoundDocument()&&(i=i.add(n)),s.isNoDocument()&&s.version.isEqual(ni.min())?(t.removeEntry(n,s.readTime),r=r.insert(n,s)):!o.isValidDocument()||s.version.compareTo(o.version)>0||0===s.version.compareTo(o.version)&&o.hasPendingWrites?(t.addEntry(s),r=r.insert(n,s)):Rr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",o.version," Watch version:",s.version)})),{us:r,cs:i}}))}function Iu(e,t){const n=Ur(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t))))}function ku(e,t){const n=Ur(e);return n.persistence.runTransaction("Allocate target","readwrite",(e=>{let r;return n.qr.getTargetData(e,t).next((i=>i?(r=i,gi.resolve(r)):n.qr.allocateTargetId(e).next((i=>(r=new Ya(t,i,"TargetPurposeListen",e.currentSequenceNumber),n.qr.addTargetData(e,r).next((()=>r)))))))})).then((e=>{const r=n.ts.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.ts=n.ts.insert(e.targetId,e),n.ns.set(t,e.targetId)),e}))}async function Au(e,t,n){const r=Ur(e),i=r.ts.get(t),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,(e=>r.persistence.referenceDelegate.removeTarget(e,i)))}catch(e){if(!_i(e))throw e;Rr("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}r.ts=r.ts.remove(t),r.ns.delete(i.target)}function Nu(e,t,n){const r=Ur(e);let i=ni.min(),s=fo();return r.persistence.runTransaction("Execute query","readwrite",(e=>function(e,t,n){const r=Ur(e),i=r.ns.get(n);return void 0!==i?gi.resolve(r.ts.get(i)):r.qr.getTargetData(t,n)}(r,e,qs(t)).next((t=>{if(t)return i=t.lastLimboFreeSnapshotVersion,r.qr.getMatchingKeysForTargetId(e,t.targetId).next((e=>{s=e}))})).next((()=>r.es.getDocumentsMatchingQuery(e,t,n?i:ni.min(),n?s:fo()))).next((e=>(Du(r,Js(t),e),{documents:e,ls:s})))))}function Du(e,t,n){let r=e.rs.get(t)||ni.min();n.forEach(((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)})),e.rs.set(t,r)}class Pu{constructor(){this.activeTargetIds=mo()}ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}As(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Es(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class xu{constructor(){this.eo=new Pu,this.no={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.eo.ds(e),this.no[e]||"not-current"}updateQueryState(e,t,n){this.no[e]=t}removeLocalQueryTarget(e){this.eo.As(e)}isLocalQueryTarget(e){return this.eo.activeTargetIds.has(e)}clearQueryState(e){delete this.no[e]}getAllActiveQueryTargets(){return this.eo.activeTargetIds}isActiveQueryTarget(e){return this.eo.activeTargetIds.has(e)}start(){return this.eo=new Pu,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class Ru{ro(e){}shutdown(){}}class Ou{constructor(){this.io=()=>this.so(),this.oo=()=>this._o(),this.ao=[],this.uo()}ro(e){this.ao.push(e)}shutdown(){window.removeEventListener("online",this.io),window.removeEventListener("offline",this.oo)}uo(){window.addEventListener("online",this.io),window.addEventListener("offline",this.oo)}so(){Rr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.ao)e(0)}_o(){Rr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.ao)e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let Lu=null;function Mu(){return null===Lu?Lu=268435456+Math.round(2147483648*Math.random()):Lu++,"0x"+Lu.toString(16)}const Fu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class ju{constructor(e){this.co=e.co,this.lo=e.lo}ho(e){this.Po=e}Io(e){this.To=e}Eo(e){this.Ao=e}onMessage(e){this.Ro=e}close(){this.lo()}send(e){this.co(e)}Vo(){this.Po()}mo(){this.To()}fo(e){this.Ao(e)}po(e){this.Ro(e)}}const Uu="WebChannelConnection";class Bu extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.yo=t+"://"+e.host,this.wo=`projects/${n}/databases/${r}`,this.So="(default)"===this.databaseId.database?`project_id=${n}`:`project_id=${n}&database_id=${r}`}get bo(){return!1}Do(e,t,n,r,i){const s=Mu(),o=this.Co(e,t.toUriEncodedString());Rr("RestConnection",`Sending RPC '${e}' ${s}:`,o,n);const a={"google-cloud-resource-prefix":this.wo,"x-goog-request-params":this.So};return this.vo(a,r,i),this.Fo(e,o,a,n).then((t=>(Rr("RestConnection",`Received RPC '${e}' ${s}: `,t),t)),(t=>{throw Lr("RestConnection",`RPC '${e}' ${s} failed with error: `,t,"url: ",o,"request:",n),t}))}Mo(e,t,n,r,i,s){return this.Do(e,t,n,r,i)}vo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+Dr,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((t,n)=>e[n]=t)),n&&n.headers.forEach(((t,n)=>e[n]=t))}Co(e,t){const n=Fu[e];return`${this.yo}/v1/${t}:${n}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Fo(e,t,n,r){const i=Mu();return new Promise(((s,o)=>{const a=new Cr;a.setWithCredentials(!0),a.listenOnce(br.COMPLETE,(()=>{try{switch(a.getLastErrorCode()){case vr.NO_ERROR:const t=a.getResponseJson();Rr(Uu,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),s(t);break;case vr.TIMEOUT:Rr(Uu,`RPC '${e}' ${i} timed out`),o(new Vr(Br.DEADLINE_EXCEEDED,"Request time out"));break;case vr.HTTP_ERROR:const n=a.getStatus();if(Rr(Uu,`RPC '${e}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(Br).indexOf(t)>=0?t:Br.UNKNOWN}(t.status);o(new Vr(e,t.message))}else o(new Vr(Br.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new Vr(Br.UNAVAILABLE,"Connection failed."));break;default:Fr()}}finally{Rr(Uu,`RPC '${e}' ${i} completed.`)}}));const u=JSON.stringify(r);Rr(Uu,`RPC '${e}' ${i} sending request:`,r),a.send(t,"POST",u,n,15)}))}xo(e,t,n){const r=Mu(),i=[this.yo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=yr(),o=_r(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},u=this.longPollingOptions.timeoutSeconds;void 0!==u&&(a.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(a.xmlHttpFactory=new Sr({})),this.vo(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const l=i.join("");Rr(Uu,`Creating RPC '${e}' stream ${r}: ${l}`,a);const c=s.createWebChannel(l,a);let h=!1,d=!1;const f=new ju({co:t=>{d?Rr(Uu,`Not sending because RPC '${e}' stream ${r} is closed:`,t):(h||(Rr(Uu,`Opening RPC '${e}' stream ${r} transport.`),c.open(),h=!0),Rr(Uu,`RPC '${e}' stream ${r} sending:`,t),c.send(t))},lo:()=>c.close()}),p=(e,t,n)=>{e.listen(t,(e=>{try{n(e)}catch(e){setTimeout((()=>{throw e}),0)}}))};return p(c,Tr.EventType.OPEN,(()=>{d||(Rr(Uu,`RPC '${e}' stream ${r} transport opened.`),f.Vo())})),p(c,Tr.EventType.CLOSE,(()=>{d||(d=!0,Rr(Uu,`RPC '${e}' stream ${r} transport closed`),f.fo())})),p(c,Tr.EventType.ERROR,(t=>{d||(d=!0,Lr(Uu,`RPC '${e}' stream ${r} transport errored:`,t),f.fo(new Vr(Br.UNAVAILABLE,"The operation could not be completed")))})),p(c,Tr.EventType.MESSAGE,(t=>{var n;if(!d){const i=t.data[0];jr(!!i);const s=i,o=s.error||(null===(n=s[0])||void 0===n?void 0:n.error);if(o){Rr(Uu,`RPC '${e}' stream ${r} received error:`,o);const t=o.status;let n=function(e){const t=Jo[e];if(void 0!==t)return ta(t)}(t),i=o.message;void 0===n&&(n=Br.INTERNAL,i="Unknown error status: "+t+" with message "+o.message),d=!0,f.fo(new Vr(n,i)),c.close()}else Rr(Uu,`RPC '${e}' stream ${r} received:`,i),f.po(i)}})),p(o,wr.STAT_EVENT,(t=>{t.stat===Er.PROXY?Rr(Uu,`RPC '${e}' stream ${r} detected buffering proxy`):t.stat===Er.NOPROXY&&Rr(Uu,`RPC '${e}' stream ${r} detected no buffering proxy`)})),setTimeout((()=>{f.mo()}),0),f}}function Vu(){return"undefined"!=typeof document?document:null}function Hu(e){return new wa(e,!0)}class zu{constructor(e,t,n=1e3,r=1.5,i=6e4){this.si=e,this.timerId=t,this.Oo=n,this.No=r,this.Lo=i,this.Bo=0,this.ko=null,this.qo=Date.now(),this.reset()}reset(){this.Bo=0}Qo(){this.Bo=this.Lo}Ko(e){this.cancel();const t=Math.floor(this.Bo+this.$o()),n=Math.max(0,Date.now()-this.qo),r=Math.max(0,t-n);r>0&&Rr("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.Bo} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.ko=this.si.enqueueAfterDelay(this.timerId,r,(()=>(this.qo=Date.now(),e()))),this.Bo*=this.No,this.Bo<this.Oo&&(this.Bo=this.Oo),this.Bo>this.Lo&&(this.Bo=this.Lo)}Uo(){null!==this.ko&&(this.ko.skipDelay(),this.ko=null)}cancel(){null!==this.ko&&(this.ko.cancel(),this.ko=null)}$o(){return(Math.random()-.5)*this.Bo}}class qu{constructor(e,t,n,r,i,s,o,a){this.si=e,this.Wo=n,this.Go=r,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.zo=0,this.jo=null,this.Ho=null,this.stream=null,this.Jo=new zu(e,t)}Yo(){return 1===this.state||5===this.state||this.Zo()}Zo(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Xo()}async stop(){this.Yo()&&await this.close(0)}e_(){this.state=0,this.Jo.reset()}t_(){this.Zo()&&null===this.jo&&(this.jo=this.si.enqueueAfterDelay(this.Wo,6e4,(()=>this.n_())))}r_(e){this.i_(),this.stream.send(e)}async n_(){if(this.Zo())return this.close(0)}i_(){this.jo&&(this.jo.cancel(),this.jo=null)}s_(){this.Ho&&(this.Ho.cancel(),this.Ho=null)}async close(e,t){this.i_(),this.s_(),this.Jo.cancel(),this.zo++,4!==e?this.Jo.reset():t&&t.code===Br.RESOURCE_EXHAUSTED?(Or(t.toString()),Or("Using maximum backoff delay to prevent overloading the backend."),this.Jo.Qo()):t&&t.code===Br.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.o_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Eo(t)}o_(){}auth(){this.state=1;const e=this.__(this.zo),t=this.zo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([e,n])=>{this.zo===t&&this.a_(e,n)}),(t=>{e((()=>{const e=new Vr(Br.UNKNOWN,"Fetching auth token failed: "+t.message);return this.u_(e)}))}))}a_(e,t){const n=this.__(this.zo);this.stream=this.c_(e,t),this.stream.ho((()=>{n((()=>this.listener.ho()))})),this.stream.Io((()=>{n((()=>(this.state=2,this.Ho=this.si.enqueueAfterDelay(this.Go,1e4,(()=>(this.Zo()&&(this.state=3),Promise.resolve()))),this.listener.Io())))})),this.stream.Eo((e=>{n((()=>this.u_(e)))})),this.stream.onMessage((e=>{n((()=>this.onMessage(e)))}))}Xo(){this.state=5,this.Jo.Ko((async()=>{this.state=0,this.start()}))}u_(e){return Rr("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}__(e){return t=>{this.si.enqueueAndForget((()=>this.zo===e?t():(Rr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Gu extends qu{constructor(e,t,n,r,i,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,s),this.serializer=i}c_(e,t){return this.connection.xo("Listen",e,t)}onMessage(e){this.Jo.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:Fr()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],s=function(e,t){return e.useProto3Json?(jr(void 0===t||"string"==typeof t),Mi.fromBase64String(t||"")):(jr(void 0===t||t instanceof Buffer||t instanceof Uint8Array),Mi.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,a=o&&function(e){const t=void 0===e.code?Br.UNKNOWN:ta(e.code);return new Vr(t,e.message||"")}(o);n=new fa(r,i,s,a||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=Pa(e,r.document.name),s=Ia(r.document.updateTime),o=r.document.createTime?Ia(r.document.createTime):ni.min(),a=new us({mapValue:{fields:r.document.fields}}),u=cs.newFoundDocument(i,s,o,a),l=r.targetIds||[],c=r.removedTargetIds||[];n=new ha(l,c,u.key,u)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=Pa(e,r.document),s=r.readTime?Ia(r.readTime):ni.min(),o=cs.newNoDocument(i,s),a=r.removedTargetIds||[];n=new ha([],a,o.key,o)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=Pa(e,r.document),s=r.removedTargetIds||[];n=new ha([],s,i,null)}else{if(!("filter"in t))return Fr();{t.filter;const e=t.filter;e.targetId;const{count:r=0,unchangedNames:i}=e,s=new Xo(r,i),o=e.targetId;n=new da(o,s)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return ni.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?ni.min():t.readTime?Ia(t.readTime):ni.min()}(e);return this.listener.l_(t,n)}h_(e){const t={};t.database=Oa(this.serializer),t.addTarget=function(e,t){let n;const r=t.target;if(n=Fs(r)?{documents:ja(e,r)}:{query:Ua(e,r)._t},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=Ta(e,t.resumeToken);const r=Ea(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(ni.min())>0){n.readTime=Sa(e,t.snapshotVersion.toTimestamp());const r=Ea(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Fr()}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.r_(t)}P_(e){const t={};t.database=Oa(this.serializer),t.removeTarget=e,this.r_(t)}}class $u extends qu{constructor(e,t,n,r,i,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,s),this.serializer=i,this.I_=!1}get T_(){return this.I_}start(){this.I_=!1,this.lastStreamToken=void 0,super.start()}o_(){this.I_&&this.E_([])}c_(e,t){return this.connection.xo("Write",e,t)}onMessage(e){if(jr(!!e.streamToken),this.lastStreamToken=e.streamToken,this.I_){this.Jo.reset();const t=function(e,t){return e&&e.length>0?(jr(void 0!==t),e.map((e=>function(e,t){let n=e.updateTime?Ia(e.updateTime):Ia(t);return n.isEqual(ni.min())&&(n=Ia(t)),new xo(n,e.transformResults||[])}(e,t)))):[]}(e.writeResults,e.commitTime),n=Ia(e.commitTime);return this.listener.d_(n,t)}return jr(!e.writeResults||0===e.writeResults.length),this.I_=!0,this.listener.A_()}R_(){const e={};e.database=Oa(this.serializer),this.r_(e)}E_(e){const t={streamToken:this.lastStreamToken,writes:e.map((e=>Fa(this.serializer,e)))};this.r_(t)}}class Ku extends class{}{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.V_=!1}m_(){if(this.V_)throw new Vr(Br.FAILED_PRECONDITION,"The client has already been terminated.")}Do(e,t,n,r){return this.m_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([i,s])=>this.connection.Do(e,Aa(t,n),r,i,s))).catch((e=>{throw"FirebaseError"===e.name?(e.code===Br.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Vr(Br.UNKNOWN,e.toString())}))}Mo(e,t,n,r,i){return this.m_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([s,o])=>this.connection.Mo(e,Aa(t,n),r,s,o,i))).catch((e=>{throw"FirebaseError"===e.name?(e.code===Br.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new Vr(Br.UNKNOWN,e.toString())}))}terminate(){this.V_=!0,this.connection.terminate()}}class Wu{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.g_=0,this.p_=null,this.y_=!0}w_(){0===this.g_&&(this.S_("Unknown"),this.p_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.p_=null,this.b_("Backend didn't respond within 10 seconds."),this.S_("Offline"),Promise.resolve()))))}D_(e){"Online"===this.state?this.S_("Unknown"):(this.g_++,this.g_>=1&&(this.C_(),this.b_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.S_("Offline")))}set(e){this.C_(),this.g_=0,"Online"===e&&(this.y_=!1),this.S_(e)}S_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}b_(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.y_?(Or(t),this.y_=!1):Rr("OnlineStateTracker",t)}C_(){null!==this.p_&&(this.p_.cancel(),this.p_=null)}}class Qu{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.v_=[],this.F_=new Map,this.M_=new Set,this.x_=[],this.O_=i,this.O_.ro((e=>{n.enqueueAndForget((async()=>{il(this)&&(Rr("RemoteStore","Restarting streams for network reachability change."),await async function(e){const t=Ur(e);t.M_.add(4),await Xu(t),t.N_.set("Unknown"),t.M_.delete(4),await Yu(t)}(this))}))})),this.N_=new Wu(n,r)}}async function Yu(e){if(il(e))for(const t of e.x_)await t(!0)}async function Xu(e){for(const t of e.x_)await t(!1)}function Ju(e,t){const n=Ur(e);n.F_.has(t.targetId)||(n.F_.set(t.targetId,t),rl(n)?nl(n):Sl(n).Zo()&&el(n,t))}function Zu(e,t){const n=Ur(e),r=Sl(n);n.F_.delete(t),r.Zo()&&tl(n,t),0===n.F_.size&&(r.Zo()?r.t_():il(n)&&n.N_.set("Unknown"))}function el(e,t){if(e.L_.xe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(ni.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}Sl(e).h_(t)}function tl(e,t){e.L_.xe(t),Sl(e).P_(t)}function nl(e){e.L_=new ma({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),ot:t=>e.F_.get(t)||null,tt:()=>e.datastore.serializer.databaseId}),Sl(e).start(),e.N_.w_()}function rl(e){return il(e)&&!Sl(e).Yo()&&e.F_.size>0}function il(e){return 0===Ur(e).M_.size}function sl(e){e.L_=void 0}async function ol(e){e.N_.set("Online")}async function al(e){e.F_.forEach(((t,n)=>{el(e,t)}))}async function ul(e,t){sl(e),rl(e)?(e.N_.D_(t),nl(e)):e.N_.set("Unknown")}async function ll(e,t,n){if(e.N_.set("Online"),t instanceof fa&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e.F_.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.F_.delete(r),e.L_.removeTarget(r))}(e,t)}catch(n){Rr("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await cl(e,n)}else if(t instanceof ha?e.L_.Ke(t):t instanceof da?e.L_.He(t):e.L_.We(t),!n.isEqual(ni.min()))try{const t=await Tu(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.L_.rt(t);return n.targetChanges.forEach(((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const i=e.F_.get(r);i&&e.F_.set(r,i.withResumeToken(n.resumeToken,t))}})),n.targetMismatches.forEach(((t,n)=>{const r=e.F_.get(t);if(!r)return;e.F_.set(t,r.withResumeToken(Mi.EMPTY_BYTE_STRING,r.snapshotVersion)),tl(e,t);const i=new Ya(r.target,t,n,r.sequenceNumber);el(e,i)})),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){Rr("RemoteStore","Failed to raise snapshot:",t),await cl(e,t)}}async function cl(e,t,n){if(!_i(t))throw t;e.M_.add(1),await Xu(e),e.N_.set("Offline"),n||(n=()=>Tu(e.localStore)),e.asyncQueue.enqueueRetryable((async()=>{Rr("RemoteStore","Retrying IndexedDB access"),await n(),e.M_.delete(1),await Yu(e)}))}function hl(e,t){return t().catch((n=>cl(e,n,t)))}async function dl(e){const t=Ur(e),n=Tl(t);let r=t.v_.length>0?t.v_[t.v_.length-1].batchId:-1;for(;fl(t);)try{const e=await Iu(t.localStore,r);if(null===e){0===t.v_.length&&n.t_();break}r=e.batchId,pl(t,e)}catch(e){await cl(t,e)}ml(t)&&gl(t)}function fl(e){return il(e)&&e.v_.length<10}function pl(e,t){e.v_.push(t);const n=Tl(e);n.Zo()&&n.T_&&n.E_(t.mutations)}function ml(e){return il(e)&&!Tl(e).Yo()&&e.v_.length>0}function gl(e){Tl(e).start()}async function yl(e){Tl(e).R_()}async function _l(e){const t=Tl(e);for(const n of e.v_)t.E_(n.mutations)}async function vl(e,t,n){const r=e.v_.shift(),i=Qo.from(r,t,n);await hl(e,(()=>e.remoteSyncer.applySuccessfulWrite(i))),await dl(e)}async function bl(e,t){t&&Tl(e).T_&&await async function(e,t){if(function(e){return ea(e)&&e!==Br.ABORTED}(t.code)){const n=e.v_.shift();Tl(e).e_(),await hl(e,(()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t))),await dl(e)}}(e,t),ml(e)&&gl(e)}async function wl(e,t){const n=Ur(e);n.asyncQueue.verifyOperationInProgress(),Rr("RemoteStore","RemoteStore received new credentials");const r=il(n);n.M_.add(3),await Xu(n),r&&n.N_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.M_.delete(3),await Yu(n)}async function El(e,t){const n=Ur(e);t?(n.M_.delete(2),await Yu(n)):t||(n.M_.add(2),await Xu(n),n.N_.set("Unknown"))}function Sl(e){return e.B_||(e.B_=function(e,t,n){const r=Ur(e);return r.m_(),new Gu(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{ho:ol.bind(null,e),Io:al.bind(null,e),Eo:ul.bind(null,e),l_:ll.bind(null,e)}),e.x_.push((async t=>{t?(e.B_.e_(),rl(e)?nl(e):e.N_.set("Unknown")):(await e.B_.stop(),sl(e))}))),e.B_}function Tl(e){return e.k_||(e.k_=function(e,t,n){const r=Ur(e);return r.m_(),new $u(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{ho:()=>Promise.resolve(),Io:yl.bind(null,e),Eo:bl.bind(null,e),A_:_l.bind(null,e),d_:vl.bind(null,e)}),e.x_.push((async t=>{t?(e.k_.e_(),await dl(e)):(await e.k_.stop(),e.v_.length>0&&(Rr("RemoteStore",`Stopping write stream with ${e.v_.length} pending writes`),e.v_=[]))}))),e.k_}class Cl{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new Hr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((e=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,r,i){const s=Date.now()+n,o=new Cl(e,t,s,r,i);return o.start(n),o}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new Vr(Br.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((e=>this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Il(e,t){if(Or("AsyncQueue",`${t}: ${e}`),_i(e))return new Vr(Br.UNAVAILABLE,`${t}: ${e}`);throw e}class kl{constructor(e){this.comparator=e?(t,n)=>e(t,n)||ai.comparator(t.key,n.key):(e,t)=>ai.comparator(e.key,t.key),this.keyedMap=so(),this.sortedSet=new Ni(this.comparator)}static emptySet(e){return new kl(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((t,n)=>(e(t),!1)))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof kl))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach((t=>{e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){const n=new kl;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class Al{constructor(){this.q_=new Ni(ai.comparator)}track(e){const t=e.doc.key,n=this.q_.get(t);n?0!==e.type&&3===n.type?this.q_=this.q_.insert(t,e):3===e.type&&1!==n.type?this.q_=this.q_.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.q_=this.q_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.q_=this.q_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.q_=this.q_.remove(t):1===e.type&&2===n.type?this.q_=this.q_.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.q_=this.q_.insert(t,{type:2,doc:e.doc}):Fr():this.q_=this.q_.insert(t,e)}Q_(){const e=[];return this.q_.inorderTraversal(((t,n)=>{e.push(n)})),e}}class Nl{constructor(e,t,n,r,i,s,o,a,u){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=u}static fromInitialDocuments(e,t,n,r,i){const s=[];return t.forEach((e=>{s.push({type:0,doc:e})})),new Nl(e,t,kl.emptySet(t),s,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Ws(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e].type!==n[e].type||!t[e].doc.isEqual(n[e].doc))return!1;return!0}}class Dl{constructor(){this.K_=void 0,this.U_=[]}W_(){return this.U_.some((e=>e.G_()))}}class Pl{constructor(){this.queries=new to((e=>Qs(e)),Ws),this.onlineState="Unknown",this.z_=new Set}}async function xl(e,t){const n=Ur(e);let r=3;const i=t.query;let s=n.queries.get(i);s?!s.W_()&&t.G_()&&(r=2):(s=new Dl,r=t.G_()?0:1);try{switch(r){case 0:s.K_=await n.onListen(i,!0);break;case 1:s.K_=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(e){const n=Il(e,`Initialization of query '${Ys(t.query)}' failed`);return void t.onError(n)}n.queries.set(i,s),s.U_.push(t),t.j_(n.onlineState),s.K_&&t.H_(s.K_)&&Ml(n)}async function Rl(e,t){const n=Ur(e),r=t.query;let i=3;const s=n.queries.get(r);if(s){const e=s.U_.indexOf(t);e>=0&&(s.U_.splice(e,1),0===s.U_.length?i=t.G_()?0:1:!s.W_()&&t.G_()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function Ol(e,t){const n=Ur(e);let r=!1;for(const e of t){const t=e.query,i=n.queries.get(t);if(i){for(const t of i.U_)t.H_(e)&&(r=!0);i.K_=e}}r&&Ml(n)}function Ll(e,t,n){const r=Ur(e),i=r.queries.get(t);if(i)for(const e of i.U_)e.onError(n);r.queries.delete(t)}function Ml(e){e.z_.forEach((e=>{e.next()}))}var Fl,jl;(jl=Fl||(Fl={})).J_="default",jl.Cache="cache";class Ul{constructor(e,t,n){this.query=e,this.Y_=t,this.Z_=!1,this.X_=null,this.onlineState="Unknown",this.options=n||{}}H_(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new Nl(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Z_?this.ea(e)&&(this.Y_.next(e),t=!0):this.ta(e,this.onlineState)&&(this.na(e),t=!0),this.X_=e,t}onError(e){this.Y_.error(e)}j_(e){this.onlineState=e;let t=!1;return this.X_&&!this.Z_&&this.ta(this.X_,e)&&(this.na(this.X_),t=!0),t}ta(e,t){if(!e.fromCache)return!0;if(!this.G_())return!0;const n="Offline"!==t;return(!this.options.ra||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}ea(e){if(e.docChanges.length>0)return!0;const t=this.X_&&this.X_.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}na(e){e=Nl.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Z_=!0,this.Y_.next(e)}G_(){return this.options.source!==Fl.Cache}}class Bl{constructor(e){this.key=e}}class Vl{constructor(e){this.key=e}}class Hl{constructor(e,t){this.query=e,this.la=t,this.ha=null,this.hasCachedResults=!1,this.current=!1,this.Pa=fo(),this.mutatedKeys=fo(),this.Ia=Zs(e),this.Ta=new kl(this.Ia)}get Ea(){return this.la}da(e,t){const n=t?t.Aa:new Al,r=t?t.Ta:this.Ta;let i=t?t.mutatedKeys:this.mutatedKeys,s=r,o=!1;const a="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,u="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal(((e,t)=>{const l=r.get(e),c=Xs(this.query,t)?t:null,h=!!l&&this.mutatedKeys.has(l.key),d=!!c&&(c.hasLocalMutations||this.mutatedKeys.has(c.key)&&c.hasCommittedMutations);let f=!1;l&&c?l.data.isEqual(c.data)?h!==d&&(n.track({type:3,doc:c}),f=!0):this.Ra(l,c)||(n.track({type:2,doc:c}),f=!0,(a&&this.Ia(c,a)>0||u&&this.Ia(c,u)<0)&&(o=!0)):!l&&c?(n.track({type:0,doc:c}),f=!0):l&&!c&&(n.track({type:1,doc:l}),f=!0,(a||u)&&(o=!0)),f&&(c?(s=s.add(c),i=d?i.add(e):i.delete(e)):(s=s.delete(e),i=i.delete(e)))})),null!==this.query.limit)for(;s.size>this.query.limit;){const e="F"===this.query.limitType?s.last():s.first();s=s.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{Ta:s,Aa:n,Zi:o,mutatedKeys:i}}Ra(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n,r){const i=this.Ta;this.Ta=e.Ta,this.mutatedKeys=e.mutatedKeys;const s=e.Aa.Q_();s.sort(((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Fr()}};return n(e)-n(t)}(e.type,t.type)||this.Ia(e.doc,t.doc))),this.Va(n),r=null!=r&&r;const o=t&&!r?this.ma():[],a=0===this.Pa.size&&this.current&&!r?1:0,u=a!==this.ha;return this.ha=a,0!==s.length||u?{snapshot:new Nl(this.query,e.Ta,i,s,e.mutatedKeys,0===a,u,!1,!!n&&n.resumeToken.approximateByteSize()>0),fa:o}:{fa:o}}j_(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({Ta:this.Ta,Aa:new Al,mutatedKeys:this.mutatedKeys,Zi:!1},!1)):{fa:[]}}ga(e){return!this.la.has(e)&&!!this.Ta.has(e)&&!this.Ta.get(e).hasLocalMutations}Va(e){e&&(e.addedDocuments.forEach((e=>this.la=this.la.add(e))),e.modifiedDocuments.forEach((e=>{})),e.removedDocuments.forEach((e=>this.la=this.la.delete(e))),this.current=e.current)}ma(){if(!this.current)return[];const e=this.Pa;this.Pa=fo(),this.Ta.forEach((e=>{this.ga(e.key)&&(this.Pa=this.Pa.add(e.key))}));const t=[];return e.forEach((e=>{this.Pa.has(e)||t.push(new Vl(e))})),this.Pa.forEach((n=>{e.has(n)||t.push(new Bl(n))})),t}pa(e){this.la=e.ls,this.Pa=fo();const t=this.da(e.documents);return this.applyChanges(t,!0)}ya(){return Nl.fromInitialDocuments(this.query,this.Ta,this.mutatedKeys,0===this.ha,this.hasCachedResults)}}class zl{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class ql{constructor(e){this.key=e,this.wa=!1}}class Gl{constructor(e,t,n,r,i,s){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.Sa={},this.ba=new to((e=>Qs(e)),Ws),this.Da=new Map,this.Ca=new Set,this.va=new Ni(ai.comparator),this.Fa=new Map,this.Ma=new lu,this.xa={},this.Oa=new Map,this.Na=ru.Nn(),this.onlineState="Unknown",this.La=void 0}get isPrimaryClient(){return!0===this.La}}async function $l(e,t,n=!0){const r=fc(e);let i;const s=r.ba.get(t);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.ya()):i=await Wl(r,t,n,!0),i}async function Kl(e,t){const n=fc(e);await Wl(n,t,!0,!1)}async function Wl(e,t,n,r){const i=await ku(e.localStore,qs(t)),s=i.targetId,o=n?e.sharedClientState.addLocalQueryTarget(s):"not-current";let a;return r&&(a=await Ql(e,t,s,"current"===o,i.resumeToken)),e.isPrimaryClient&&n&&Ju(e.remoteStore,i),a}async function Ql(e,t,n,r,i){e.Ba=(t,n,r)=>async function(e,t,n,r){let i=t.view.da(n);i.Zi&&(i=await Nu(e.localStore,t.query,!1).then((({documents:e})=>t.view.da(e,i))));const s=r&&r.targetChanges.get(t.targetId),o=r&&null!=r.targetMismatches.get(t.targetId),a=t.view.applyChanges(i,e.isPrimaryClient,s,o);return ac(e,t.targetId,a.fa),a.snapshot}(e,t,n,r);const s=await Nu(e.localStore,t,!0),o=new Hl(t,s.ls),a=o.da(s.documents),u=ca.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,i),l=o.applyChanges(a,e.isPrimaryClient,u);ac(e,n,l.fa);const c=new zl(t,n,o);return e.ba.set(t,c),e.Da.has(n)?e.Da.get(n).push(t):e.Da.set(n,[t]),l.snapshot}async function Yl(e,t,n){const r=Ur(e),i=r.ba.get(t),s=r.Da.get(i.targetId);if(s.length>1)return r.Da.set(i.targetId,s.filter((e=>!Ws(e,t)))),void r.ba.delete(t);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await Au(r.localStore,i.targetId,!1).then((()=>{r.sharedClientState.clearQueryState(i.targetId),n&&Zu(r.remoteStore,i.targetId),sc(r,i.targetId)})).catch(mi)):(sc(r,i.targetId),await Au(r.localStore,i.targetId,!0))}async function Xl(e,t){const n=Ur(e),r=n.ba.get(t),i=n.Da.get(r.targetId);n.isPrimaryClient&&1===i.length&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),Zu(n.remoteStore,r.targetId))}async function Jl(e,t){const n=Ur(e);try{const e=await function(e,t){const n=Ur(e),r=t.snapshotVersion;let i=n.ts;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(e=>{const s=n.ss.newChangeBuffer({trackRemovals:!0});i=n.ts;const o=[];t.targetChanges.forEach(((s,a)=>{const u=i.get(a);if(!u)return;o.push(n.qr.removeMatchingKeys(e,s.removedDocuments,a).next((()=>n.qr.addMatchingKeys(e,s.addedDocuments,a))));let l=u.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(a)?l=l.withResumeToken(Mi.EMPTY_BYTE_STRING,ni.min()).withLastLimboFreeSnapshotVersion(ni.min()):s.resumeToken.approximateByteSize()>0&&(l=l.withResumeToken(s.resumeToken,r)),i=i.insert(a,l),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(u,l,s)&&o.push(n.qr.updateTargetData(e,l))}));let a=ro(),u=fo();if(t.documentUpdates.forEach((r=>{t.resolvedLimboDocuments.has(r)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))})),o.push(Cu(e,s,t.documentUpdates).next((e=>{a=e.us,u=e.cs}))),!r.isEqual(ni.min())){const t=n.qr.getLastRemoteSnapshotVersion(e).next((t=>n.qr.setTargetsMetadata(e,e.currentSequenceNumber,r)));o.push(t)}return gi.waitFor(o).next((()=>s.apply(e))).next((()=>n.localDocuments.getLocalViewOfDocuments(e,a,u))).next((()=>a))})).then((e=>(n.ts=i,e)))}(n.localStore,t);t.targetChanges.forEach(((e,t)=>{const r=n.Fa.get(t);r&&(jr(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?r.wa=!0:e.modifiedDocuments.size>0?jr(r.wa):e.removedDocuments.size>0&&(jr(r.wa),r.wa=!1))})),await cc(n,e,t)}catch(e){await mi(e)}}function Zl(e,t,n){const r=Ur(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.ba.forEach(((n,r)=>{const i=r.view.j_(t);i.snapshot&&e.push(i.snapshot)})),function(e,t){const n=Ur(e);n.onlineState=t;let r=!1;n.queries.forEach(((e,n)=>{for(const e of n.U_)e.j_(t)&&(r=!0)})),r&&Ml(n)}(r.eventManager,t),e.length&&r.Sa.l_(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function ec(e,t,n){const r=Ur(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.Fa.get(t),s=i&&i.key;if(s){let e=new Ni(ai.comparator);e=e.insert(s,cs.newNoDocument(s,ni.min()));const n=fo().add(s),i=new la(ni.min(),new Map,new Ni(Zr),e,n);await Jl(r,i),r.va=r.va.remove(s),r.Fa.delete(t),lc(r)}else await Au(r.localStore,t,!1).then((()=>sc(r,t,n))).catch(mi)}async function tc(e,t){const n=Ur(e),r=t.batch.batchId;try{const e=await function(e,t){const n=Ur(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(e=>{const r=t.batch.keys(),i=n.ss.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const i=n.batch,s=i.keys();let o=gi.resolve();return s.forEach((e=>{o=o.next((()=>r.getEntry(t,e))).next((t=>{const s=n.docVersions.get(e);jr(null!==s),t.version.compareTo(s)<0&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))}))})),o.next((()=>e.mutationQueue.removeMutationBatch(t,i)))}(n,e,t,i).next((()=>i.apply(e))).next((()=>n.mutationQueue.performConsistencyCheck(e))).next((()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId))).next((()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=fo();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t)))).next((()=>n.localDocuments.getDocuments(e,r)))}))}(n.localStore,t);ic(n,r,null),rc(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await cc(n,e)}catch(e){await mi(e)}}async function nc(e,t,n){const r=Ur(e);try{const e=await function(e,t){const n=Ur(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(e=>{let r;return n.mutationQueue.lookupMutationBatch(e,t).next((t=>(jr(null!==t),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t)))).next((()=>n.mutationQueue.performConsistencyCheck(e))).next((()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t))).next((()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r))).next((()=>n.localDocuments.getDocuments(e,r)))}))}(r.localStore,t);ic(r,t,n),rc(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await cc(r,e)}catch(n){await mi(n)}}function rc(e,t){(e.Oa.get(t)||[]).forEach((e=>{e.resolve()})),e.Oa.delete(t)}function ic(e,t,n){const r=Ur(e);let i=r.xa[r.currentUser.toKey()];if(i){const e=i.get(t);e&&(n?e.reject(n):e.resolve(),i=i.remove(t)),r.xa[r.currentUser.toKey()]=i}}function sc(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.Da.get(t))e.ba.delete(r),n&&e.Sa.ka(r,n);e.Da.delete(t),e.isPrimaryClient&&e.Ma.Rr(t).forEach((t=>{e.Ma.containsKey(t)||oc(e,t)}))}function oc(e,t){e.Ca.delete(t.path.canonicalString());const n=e.va.get(t);null!==n&&(Zu(e.remoteStore,n),e.va=e.va.remove(t),e.Fa.delete(n),lc(e))}function ac(e,t,n){for(const r of n)r instanceof Bl?(e.Ma.addReference(r.key,t),uc(e,r)):r instanceof Vl?(Rr("SyncEngine","Document no longer in limbo: "+r.key),e.Ma.removeReference(r.key,t),e.Ma.containsKey(r.key)||oc(e,r.key)):Fr()}function uc(e,t){const n=t.key,r=n.path.canonicalString();e.va.get(n)||e.Ca.has(r)||(Rr("SyncEngine","New document in limbo: "+n),e.Ca.add(r),lc(e))}function lc(e){for(;e.Ca.size>0&&e.va.size<e.maxConcurrentLimboResolutions;){const t=e.Ca.values().next().value;e.Ca.delete(t);const n=new ai(ii.fromString(t)),r=e.Na.next();e.Fa.set(r,new ql(n)),e.va=e.va.insert(n,r),Ju(e.remoteStore,new Ya(qs(Bs(n.path)),r,"TargetPurposeLimboResolution",vi.oe))}}async function cc(e,t,n){const r=Ur(e),i=[],s=[],o=[];r.ba.isEmpty()||(r.ba.forEach(((e,a)=>{o.push(r.Ba(a,t,n).then((e=>{if((e||n)&&r.isPrimaryClient&&r.sharedClientState.updateQueryState(a.targetId,(null==e?void 0:e.fromCache)?"not-current":"current"),e){i.push(e);const t=_u.Qi(a.targetId,e);s.push(t)}})))})),await Promise.all(o),r.Sa.l_(i),await async function(e,t){const n=Ur(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(e=>gi.forEach(t,(t=>gi.forEach(t.ki,(r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r))).next((()=>gi.forEach(t.qi,(r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))))))}catch(e){if(!_i(e))throw e;Rr("LocalStore","Failed to update sequence numbers: "+e)}for(const e of t){const t=e.targetId;if(!e.fromCache){const e=n.ts.get(t),r=e.snapshotVersion,i=e.withLastLimboFreeSnapshotVersion(r);n.ts=n.ts.insert(t,i)}}}(r.localStore,s))}async function hc(e,t){const n=Ur(e);if(!n.currentUser.isEqual(t)){Rr("SyncEngine","User change. New user:",t.toKey());const e=await Su(n.localStore,t);n.currentUser=t,function(e,t){e.Oa.forEach((e=>{e.forEach((e=>{e.reject(new Vr(Br.CANCELLED,t))}))})),e.Oa.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await cc(n,e._s)}}function dc(e,t){const n=Ur(e),r=n.Fa.get(t);if(r&&r.wa)return fo().add(r.key);{let e=fo();const r=n.Da.get(t);if(!r)return e;for(const t of r){const r=n.ba.get(t);e=e.unionWith(r.view.Ea)}return e}}function fc(e){const t=Ur(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=Jl.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=dc.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=ec.bind(null,t),t.Sa.l_=Ol.bind(null,t.eventManager),t.Sa.ka=Ll.bind(null,t.eventManager),t}function pc(e){const t=Ur(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=tc.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=nc.bind(null,t),t}class mc{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=Hu(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){return Eu(this.persistence,new bu,e.initialUser,this.serializer)}createPersistence(e){return new mu(yu.jr,this.serializer)}createSharedClientState(e){return new xu}async terminate(){var e,t;null===(e=this.gcScheduler)||void 0===e||e.stop(),null===(t=this.indexBackfillerScheduler)||void 0===t||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class gc{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>Zl(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=hc.bind(null,this.syncEngine),await El(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new Pl}createDatastore(e){const t=Hu(e.databaseInfo.databaseId),n=function(e){return new Bu(e)}(e.databaseInfo);return function(e,t,n,r){return new Ku(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return function(e,t,n,r,i){return new Qu(e,t,n,r,i)}(this.localStore,this.datastore,e.asyncQueue,(e=>Zl(this.syncEngine,e,0)),Ou.D()?new Ou:new Ru)}createSyncEngine(e,t){return function(e,t,n,r,i,s,o){const a=new Gl(e,t,n,r,i,s);return o&&(a.La=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e;await async function(e){const t=Ur(e);Rr("RemoteStore","RemoteStore shutting down."),t.M_.add(5),await Xu(t),t.O_.shutdown(),t.N_.set("Unknown")}(this.remoteStore),null===(e=this.datastore)||void 0===e||e.terminate()}}class yc{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Ka(this.observer.next,e)}error(e){this.observer.error?this.Ka(this.observer.error,e):Or("Uncaught Error in snapshot listener:",e.toString())}$a(){this.muted=!0}Ka(e,t){this.muted||setTimeout((()=>{this.muted||e(t)}),0)}}class _c{constructor(e,t,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=Nr.UNAUTHENTICATED,this.clientId=Jr.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,(async e=>{Rr("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e})),this.appCheckCredentials.start(n,(e=>(Rr("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new Vr(Br.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Hr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=Il(t,"Failed to shutdown persistence");e.reject(n)}})),e.promise}}async function vc(e,t){e.asyncQueue.verifyOperationInProgress(),Rr("FirestoreClient","Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener((async e=>{r.isEqual(e)||(await Su(t.localStore,e),r=e)})),t.persistence.setDatabaseDeletedListener((()=>e.terminate())),e._offlineComponents=t}async function bc(e,t){e.asyncQueue.verifyOperationInProgress();const n=await Ec(e);Rr("FirestoreClient","Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener((e=>wl(t.remoteStore,e))),e.setAppCheckTokenChangeListener(((e,n)=>wl(t.remoteStore,n))),e._onlineComponents=t}function wc(e){return"FirebaseError"===e.name?e.code===Br.FAILED_PRECONDITION||e.code===Br.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}async function Ec(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Rr("FirestoreClient","Using user provided OfflineComponentProvider");try{await vc(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!wc(n))throw n;Lr("Error using user provided cache. Falling back to memory cache: "+n),await vc(e,new mc)}}else Rr("FirestoreClient","Using default OfflineComponentProvider"),await vc(e,new mc);return e._offlineComponents}async function Sc(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Rr("FirestoreClient","Using user provided OnlineComponentProvider"),await bc(e,e._uninitializedComponentsProvider._online)):(Rr("FirestoreClient","Using default OnlineComponentProvider"),await bc(e,new gc))),e._onlineComponents}function Tc(e){return Sc(e).then((e=>e.syncEngine))}async function Cc(e){const t=await Sc(e),n=t.eventManager;return n.onListen=$l.bind(null,t.syncEngine),n.onUnlisten=Yl.bind(null,t.syncEngine),n.onFirstRemoteStoreListen=Kl.bind(null,t.syncEngine),n.onLastRemoteStoreUnlisten=Xl.bind(null,t.syncEngine),n}function Ic(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const kc=new Map;function Ac(e,t,n){if(!n)throw new Vr(Br.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function Nc(e){if(!ai.isDocumentKey(e))throw new Vr(Br.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function Dc(e){if(ai.isDocumentKey(e))throw new Vr(Br.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function Pc(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":Fr()}function xc(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new Vr(Br.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Pc(e);throw new Vr(Br.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}class Rc{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new Vr(Br.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new Vr(Br.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,n,r){if(!0===t&&!0===r)throw new Vr(Br.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Ic(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new Vr(Br.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new Vr(Br.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new Vr(Br.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Oc{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Rc({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new Vr(Br.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new Vr(Br.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Rc(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new qr;switch(e.type){case"firstParty":return new Wr(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new Vr(Br.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=kc.get(e);t&&(Rr("ComponentProvider","Removing Datastore"),kc.delete(e),t.terminate())}(this),Promise.resolve()}}class Lc{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new Lc(this.firestore,e,this._query)}}class Mc{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Fc(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Mc(this.firestore,e,this._key)}}class Fc extends Lc{constructor(e,t,n){super(e,t,Bs(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Mc(this.firestore,null,new ai(e))}withConverter(e){return new Fc(this.firestore,e,this._path)}}function jc(e,t,...n){if(e=(0,a.Ku)(e),Ac("collection","path",t),e instanceof Oc){const r=ii.fromString(t,...n);return Dc(r),new Fc(e,null,r)}{if(!(e instanceof Mc||e instanceof Fc))throw new Vr(Br.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ii.fromString(t,...n));return Dc(r),new Fc(e.firestore,null,r)}}function Uc(e,t,...n){if(e=(0,a.Ku)(e),1===arguments.length&&(t=Jr.newId()),Ac("doc","path",t),e instanceof Oc){const r=ii.fromString(t,...n);return Nc(r),new Mc(e,null,new ai(r))}{if(!(e instanceof Mc||e instanceof Fc))throw new Vr(Br.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ii.fromString(t,...n));return Nc(r),new Mc(e.firestore,e instanceof Fc?e.converter:null,new ai(r))}}class Bc{constructor(){this.iu=Promise.resolve(),this.su=[],this.ou=!1,this._u=[],this.au=null,this.uu=!1,this.cu=!1,this.lu=[],this.Jo=new zu(this,"async_queue_retry"),this.hu=()=>{const e=Vu();e&&Rr("AsyncQueue","Visibility state changed to "+e.visibilityState),this.Jo.Uo()};const e=Vu();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.hu)}get isShuttingDown(){return this.ou}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Pu(),this.Iu(e)}enterRestrictedMode(e){if(!this.ou){this.ou=!0,this.cu=e||!1;const t=Vu();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.hu)}}enqueue(e){if(this.Pu(),this.ou)return new Promise((()=>{}));const t=new Hr;return this.Iu((()=>this.ou&&this.cu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise))).then((()=>t.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.su.push(e),this.Tu())))}async Tu(){if(0!==this.su.length){try{await this.su[0](),this.su.shift(),this.Jo.reset()}catch(e){if(!_i(e))throw e;Rr("AsyncQueue","Operation failed with retryable error: "+e)}this.su.length>0&&this.Jo.Ko((()=>this.Tu()))}}Iu(e){const t=this.iu.then((()=>(this.uu=!0,e().catch((e=>{this.au=e,this.uu=!1;const t=function(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e);throw Or("INTERNAL UNHANDLED ERROR: ",t),e})).then((e=>(this.uu=!1,e))))));return this.iu=t,t}enqueueAfterDelay(e,t,n){this.Pu(),this.lu.indexOf(e)>-1&&(t=0);const r=Cl.createAndSchedule(this,e,t,n,(e=>this.Eu(e)));return this._u.push(r),r}Pu(){this.au&&Fr()}verifyOperationInProgress(){}async du(){let e;do{e=this.iu,await e}while(e!==this.iu)}Au(e){for(const t of this._u)if(t.timerId===e)return!0;return!1}Ru(e){return this.du().then((()=>{this._u.sort(((e,t)=>e.targetTimeMs-t.targetTimeMs));for(const t of this._u)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.du()}))}Vu(e){this.lu.push(e)}Eu(e){const t=this._u.indexOf(e);this._u.splice(t,1)}}function Vc(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const n=e;for(const e of t)if(e in n&&"function"==typeof n[e])return!0;return!1}(e,["next","error","complete"])}class Hc extends Oc{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new Bc,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Gc(this),this._firestoreClient.terminate()}}function zc(e,t){const n="object"==typeof e?e:(0,i.Sx)(),r="string"==typeof e?e:t||"(default)",s=(0,i.j6)(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const e=(0,a.yU)("firestore");e&&function(e,t,n,r={}){var i;const s=(e=xc(e,Oc))._getSettings(),o=`${t}:${n}`;if("firestore.googleapis.com"!==s.host&&s.host!==o&&Lr("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),r.mockUserToken){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=Nr.MOCK_USER;else{t=(0,a.Fy)(r.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);const s=r.mockUserToken.sub||r.mockUserToken.user_id;if(!s)throw new Vr(Br.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Nr(s)}e._authCredentials=new Gr(new zr(t,n))}}(s,...e)}return s}function qc(e){return e._firestoreClient||Gc(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Gc(e){var t,n,r;const i=e._freezeSettings(),s=function(e,t,n,r){return new qi(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,Ic(r.experimentalLongPollingOptions),r.useFetchStreams)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new _c(e._authCredentials,e._appCheckCredentials,e._queue,s),(null===(n=i.localCache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=i.localCache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.localCache.kind,_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider})}class $c{constructor(e){this._byteString=e}static fromBase64String(e){try{return new $c(Mi.fromBase64String(e))}catch(e){throw new Vr(Br.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new $c(Mi.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class Kc{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new Vr(Br.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new oi(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class Wc{constructor(e){this._methodName=e}}class Qc{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Vr(Br.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Vr(Br.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Zr(this._lat,e._lat)||Zr(this._long,e._long)}}const Yc=/^__.*__$/;class Xc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Ho(e,this.data,this.fieldMask,t,this.fieldTransforms):new Vo(e,this.data,t,this.fieldTransforms)}}class Jc{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new Ho(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Zc(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Fr()}}class eh{constructor(e,t,n,r,i,s){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.mu(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get fu(){return this.settings.fu}gu(e){return new eh(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}pu(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.gu({path:n,yu:!1});return r.wu(e),r}Su(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.gu({path:n,yu:!1});return r.mu(),r}bu(e){return this.gu({path:void 0,yu:!0})}Du(e){return gh(e,this.settings.methodName,this.settings.Cu||!1,this.path,this.settings.vu)}contains(e){return void 0!==this.fieldMask.find((t=>e.isPrefixOf(t)))||void 0!==this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))}mu(){if(this.path)for(let e=0;e<this.path.length;e++)this.wu(this.path.get(e))}wu(e){if(0===e.length)throw this.Du("Document fields must not be empty");if(Zc(this.fu)&&Yc.test(e))throw this.Du('Document fields cannot begin and end with "__"')}}class th{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||Hu(e)}Fu(e,t,n,r=!1){return new eh({fu:e,methodName:t,vu:n,path:oi.emptyPath(),yu:!1,Cu:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function nh(e){const t=e._freezeSettings(),n=Hu(e._databaseId);return new th(e._databaseId,!!t.ignoreUndefinedProperties,n)}function rh(e,t,n,r,i,s={}){const o=e.Fu(s.merge||s.mergeFields?2:0,t,n,i);dh("Data must be an object, but it was:",o,r);const a=ch(r,o);let u,l;if(s.merge)u=new Oi(o.fieldMask),l=o.fieldTransforms;else if(s.mergeFields){const e=[];for(const r of s.mergeFields){const i=fh(t,r,n);if(!o.contains(i))throw new Vr(Br.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);yh(e,i)||e.push(i)}u=new Oi(e),l=o.fieldTransforms.filter((e=>u.covers(e.field)))}else u=null,l=o.fieldTransforms;return new Xc(new us(a),u,l)}class ih extends Wc{_toFieldTransform(e){if(2!==e.fu)throw 1===e.fu?e.Du(`${this._methodName}() can only appear at the top level of your update data`):e.Du(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof ih}}class sh extends Wc{_toFieldTransform(e){return new Po(e.path,new So)}isEqual(e){return e instanceof sh}}function oh(e,t,n,r){const i=e.Fu(1,t,n);dh("Data must be an object, but it was:",i,r);const s=[],o=us.empty();ki(r,((e,r)=>{const u=mh(t,e,n);r=(0,a.Ku)(r);const l=i.Su(u);if(r instanceof ih)s.push(u);else{const e=lh(r,l);null!=e&&(s.push(u),o.set(u,e))}}));const u=new Oi(s);return new Jc(o,u,i.fieldTransforms)}function ah(e,t,n,r,i,s){const o=e.Fu(1,t,n),u=[fh(t,r,n)],l=[i];if(s.length%2!=0)throw new Vr(Br.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let e=0;e<s.length;e+=2)u.push(fh(t,s[e])),l.push(s[e+1]);const c=[],h=us.empty();for(let e=u.length-1;e>=0;--e)if(!yh(c,u[e])){const t=u[e];let n=l[e];n=(0,a.Ku)(n);const r=o.Su(t);if(n instanceof ih)c.push(t);else{const e=lh(n,r);null!=e&&(c.push(t),h.set(t,e))}}const d=new Oi(c);return new Jc(h,d,o.fieldTransforms)}function uh(e,t,n,r=!1){return lh(n,e.Fu(r?4:3,t))}function lh(e,t){if(hh(e=(0,a.Ku)(e)))return dh("Unsupported field value:",t,e),ch(e,t);if(e instanceof Wc)return function(e,t){if(!Zc(t.fu))throw t.Du(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.Du(`${e._methodName}() is not currently supported inside arrays`);const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.yu&&4!==t.fu)throw t.Du("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const i of e){let e=lh(i,t.bu(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=(0,a.Ku)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return _o(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=ti.fromDate(e);return{timestampValue:Sa(t.serializer,n)}}if(e instanceof ti){const n=new ti(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:Sa(t.serializer,n)}}if(e instanceof Qc)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof $c)return{bytesValue:Ta(t.serializer,e._byteString)};if(e instanceof Mc){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.Du(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:ka(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.Du(`Unsupported field value: ${Pc(e)}`)}(e,t)}function ch(e,t){const n={};return Ai(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ki(e,((e,r)=>{const i=lh(r,t.pu(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function hh(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof ti||e instanceof Qc||e instanceof $c||e instanceof Mc||e instanceof Wc)}function dh(e,t,n){if(!hh(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){const r=Pc(n);throw"an object"===r?t.Du(e+" a custom object"):t.Du(e+" "+r)}}function fh(e,t,n){if((t=(0,a.Ku)(t))instanceof Kc)return t._internalPath;if("string"==typeof t)return mh(e,t);throw gh("Field path arguments must be of type string or ",e,!1,void 0,n)}const ph=new RegExp("[~\\*/\\[\\]]");function mh(e,t,n){if(t.search(ph)>=0)throw gh(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new Kc(...t.split("."))._internalPath}catch(r){throw gh(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function gh(e,t,n,r,i){const s=r&&!r.isEmpty(),o=void 0!==i;let a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new Vr(Br.INVALID_ARGUMENT,a+e+u)}function yh(e,t){return e.some((e=>e.isEqual(t)))}class _h{constructor(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Mc(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new vh(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(bh("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class vh extends _h{data(){return super.data()}}function bh(e,t){return"string"==typeof t?mh(e,t):t instanceof Kc?t._internalPath:t._delegate._internalPath}function wh(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new Vr(Br.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Eh{}class Sh extends Eh{}function Th(e,t,...n){let r=[];t instanceof Eh&&r.push(t),r=r.concat(n),function(e){const t=e.filter((e=>e instanceof kh)).length,n=e.filter((e=>e instanceof Ch)).length;if(t>1||t>0&&n>0)throw new Vr(Br.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const t of r)e=t._apply(e);return e}class Ch extends Sh{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new Ch(e,t,n)}_apply(e){const t=this._parse(e);return Dh(e._query,t),new Lc(e.firestore,e.converter,$s(e._query,t))}_parse(e){const t=nh(e.firestore),n=function(e,t,n,r,i,s,o){let a;if(i.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new Vr(Br.INVALID_ARGUMENT,`Invalid Query. You can't perform '${s}' queries on documentId().`);if("in"===s||"not-in"===s){Nh(o,s);const t=[];for(const n of o)t.push(Ah(r,e,n));a={arrayValue:{values:t}}}else a=Ah(r,e,o)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||Nh(o,s),a=uh(n,t,o,"in"===s||"not-in"===s);return ys.create(i,s,a)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value);return n}}function Ih(e,t,n){const r=t,i=bh("where",e);return Ch._create(i,r,n)}class kh extends Eh{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new kh(e,t)}_parse(e){const t=this._queryConstraints.map((t=>t._parse(e))).filter((e=>e.getFilters().length>0));return 1===t.length?t[0]:_s.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const r=t.getFlattenedFilters();for(const e of r)Dh(n,e),n=$s(n,e)}(e._query,t),new Lc(e.firestore,e.converter,$s(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}function Ah(e,t,n){if("string"==typeof(n=(0,a.Ku)(n))){if(""===n)throw new Vr(Br.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Hs(t)&&-1!==n.indexOf("/"))throw new Vr(Br.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=t.path.child(ii.fromString(n));if(!ai.isDocumentKey(r))throw new Vr(Br.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return es(e,new ai(r))}if(n instanceof Mc)return es(e,n._key);throw new Vr(Br.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Pc(n)}.`)}function Nh(e,t){if(!Array.isArray(e)||0===e.length)throw new Vr(Br.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function Dh(e,t){const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new Vr(Br.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new Vr(Br.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}class Ph{convertValue(e,t="none"){switch(Ki(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Ui(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Bi(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw Fr()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return ki(e,((e,r)=>{n[e]=this.convertValue(r,t)})),n}convertGeoPoint(e){return new Qc(Ui(e.latitude),Ui(e.longitude))}convertArray(e,t){return(e.values||[]).map((e=>this.convertValue(e,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const n=Hi(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(zi(e));default:return null}}convertTimestamp(e){const t=ji(e);return new ti(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=ii.fromString(e);jr(Qa(n));const r=new Gi(n.get(1),n.get(3)),i=new ai(n.popFirst(5));return r.isEqual(t)||Or(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}function xh(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class Rh{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Oh extends _h{constructor(e,t,n,r,i,s){super(e,t,n,r,s),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Lh(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(bh("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class Lh extends Oh{data(e={}){return super.data(e)}}class Mh{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new Rh(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach((n=>{e.call(t,new Lh(this._firestore,this._userDataWriter,n.key,n,new Rh(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Vr(Br.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map((n=>{const r=new Lh(e._firestore,e._userDataWriter,n.doc.key,n.doc,new Rh(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}}))}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((e=>t||3!==e.type)).map((t=>{const r=new Lh(e._firestore,e._userDataWriter,t.doc.key,t.doc,new Rh(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let i=-1,s=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),s=n.indexOf(t.doc.key)),{type:Fh(t.type),doc:r,oldIndex:i,newIndex:s}}))}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function Fh(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Fr()}}class jh extends Ph{constructor(e){super(),this.firestore=e}convertBytes(e){return new $c(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Mc(this.firestore,null,t)}}function Uh(e,t,n){e=xc(e,Mc);const r=xc(e.firestore,Hc),i=xh(e.converter,t,n);return qh(r,[rh(nh(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,Ro.none())])}function Bh(e,t,n,...r){e=xc(e,Mc);const i=xc(e.firestore,Hc),s=nh(i);let o;return o="string"==typeof(t=(0,a.Ku)(t))||t instanceof Kc?ah(s,"updateDoc",e._key,t,n,r):oh(s,"updateDoc",e._key,t),qh(i,[o.toMutation(e._key,Ro.exists(!0))])}function Vh(e){return qh(xc(e.firestore,Hc),[new $o(e._key,Ro.none())])}function Hh(e,t){const n=xc(e.firestore,Hc),r=Uc(e),i=xh(e.converter,t);return qh(n,[rh(nh(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,Ro.exists(!1))]).then((()=>r))}function zh(e,...t){var n,r,i;e=(0,a.Ku)(e);let s={includeMetadataChanges:!1,source:"default"},o=0;"object"!=typeof t[o]||Vc(t[o])||(s=t[o],o++);const u={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(Vc(t[o])){const e=t[o];t[o]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[o+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[o+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let l,c,h;if(e instanceof Mc)c=xc(e.firestore,Hc),h=Bs(e._key.path),l={next:n=>{t[o]&&t[o](Gh(c,e,n))},error:t[o+1],complete:t[o+2]};else{const n=xc(e,Lc);c=xc(n.firestore,Hc),h=n._query;const r=new jh(c);l={next:e=>{t[o]&&t[o](new Mh(c,r,n,e))},error:t[o+1],complete:t[o+2]},wh(e._query)}return function(e,t,n,r){const i=new yc(r),s=new Ul(t,i,n);return e.asyncQueue.enqueueAndForget((async()=>xl(await Cc(e),s))),()=>{i.$a(),e.asyncQueue.enqueueAndForget((async()=>Rl(await Cc(e),s)))}}(qc(c),h,u,l)}function qh(e,t){return function(e,t){const n=new Hr;return e.asyncQueue.enqueueAndForget((async()=>async function(e,t,n){const r=pc(e);try{const e=await function(e,t){const n=Ur(e),r=ti.now(),i=t.reduce(((e,t)=>e.add(t.key)),fo());let s,o;return n.persistence.runTransaction("Locally write mutations","readwrite",(e=>{let a=ro(),u=fo();return n.ss.getEntries(e,i).next((e=>{a=e,a.forEach(((e,t)=>{t.isValidDocument()||(u=u.add(e))}))})).next((()=>n.localDocuments.getOverlayedDocuments(e,a))).next((i=>{s=i;const o=[];for(const e of t){const t=Uo(e,s.get(e.key).overlayedDocument);null!=t&&o.push(new Ho(e.key,t,ls(t.value.mapValue),Ro.exists(!0)))}return n.mutationQueue.addMutationBatch(e,r,o,t)})).next((t=>{o=t;const r=t.applyToLocalDocumentSet(s,u);return n.documentOverlayCache.saveOverlays(e,t.batchId,r)}))})).then((()=>({batchId:o.batchId,changes:oo(s)})))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.xa[e.currentUser.toKey()];r||(r=new Ni(Zr)),r=r.insert(t,n),e.xa[e.currentUser.toKey()]=r}(r,e.batchId,n),await cc(r,e.changes),await dl(r.remoteStore)}catch(e){const t=Il(e,"Failed to persist write");n.reject(t)}}(await Tc(e),t,n))),n.promise}(qc(e),t)}function Gh(e,t,n){const r=n.docs.get(t._key),i=new jh(e);return new Oh(e,i,t._key,r,new Rh(n.hasPendingWrites,n.fromCache),t.converter)}function $h(){return new ih("deleteField")}function Kh(){return new sh("serverTimestamp")}new WeakMap;!function(e,t=!0){!function(e){Dr=e}(i.MF),(0,i.om)(new s.uA("firestore",((e,{instanceIdentifier:n,options:r})=>{const i=e.getProvider("app").getImmediate(),s=new Hc(new $r(e.getProvider("auth-internal")),new Yr(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new Vr(Br.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Gi(e.options.projectId,t)}(i,n),i);return r=Object.assign({useFetchStreams:t},r),s._setSettings(r),s}),"PUBLIC").setMultipleInstances(!0)),(0,i.KO)(Ar,"4.6.1",e),(0,i.KO)(Ar,"4.6.1","esm2017")}()},"./node_modules/react-hook-form/dist/index.esm.mjs":function(e,t,n){"use strict";n.d(t,{Op:function(){return N},as:function(){return V},mN:function(){return Ae},xW:function(){return A}});var r=n("./node_modules/react/index.js"),i=e=>"checkbox"===e.type,s=e=>e instanceof Date,o=e=>null==e;const a=e=>"object"==typeof e;var u=e=>!o(e)&&!Array.isArray(e)&&a(e)&&!s(e),l=e=>u(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,c=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),h=e=>{const t=e.constructor&&e.constructor.prototype;return u(t)&&t.hasOwnProperty("isPrototypeOf")},d="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function f(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(d&&(e instanceof Blob||e instanceof FileList)||!n&&!u(e))return e;if(t=n?[]:{},n||h(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=f(e[n]));else t=e}return t}var p=e=>Array.isArray(e)?e.filter(Boolean):[],m=e=>void 0===e,g=(e,t,n)=>{if(!t||!u(e))return n;const r=p(t.split(/[,[\].]+?/)).reduce(((e,t)=>o(e)?e:e[t]),e);return m(r)||r===e?m(e[t])?n:e[t]:r},y=e=>"boolean"==typeof e;const _={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},v={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},b="max",w="min",E="maxLength",S="minLength",T="pattern",C="required",I="validate",k=r.createContext(null),A=()=>r.useContext(k),N=e=>{const{children:t,...n}=e;return r.createElement(k.Provider,{value:n},t)};var D=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const i=s;return t._proxyFormState[i]!==v.all&&(t._proxyFormState[i]=!r||v.all),n&&(n[i]=!0),e[i]}});return i},P=e=>u(e)&&!Object.keys(e).length,x=(e,t,n,r)=>{n(e);const{name:i,...s}=e;return P(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find((e=>t[e]===(!r||v.all)))},R=e=>Array.isArray(e)?e:[e],O=(e,t,n)=>!e||!t||e===t||R(e).some((e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e))));function L(e){const t=r.useRef(e);t.current=e,r.useEffect((()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var M=e=>"string"==typeof e,F=(e,t,n,r,i)=>M(e)?(r&&t.watch.add(e),g(n,e,i)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),g(n,e)))):(r&&(t.watchAll=!0),n);var j=e=>/^\w*$/.test(e),U=e=>p(e.replace(/["|']|\]/g,"").split(/\.|\[/)),B=(e,t,n)=>{let r=-1;const i=j(t)?[t]:U(t),s=i.length,o=s-1;for(;++r<s;){const t=i[r];let s=n;if(r!==o){const n=e[t];s=u(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=s,e=e[t]}return e};function V(e){const t=A(),{name:n,disabled:i,control:s=t.control,shouldUnregister:o}=e,a=c(s._names.array,n),u=function(e){const t=A(),{control:n=t.control,name:i,defaultValue:s,disabled:o,exact:a}=e||{},u=r.useRef(i);u.current=i,L({disabled:o,subject:n._subjects.values,next:e=>{O(u.current,e.name,a)&&c(f(F(u.current,n._names,e.values||n._formValues,!1,s)))}});const[l,c]=r.useState(n._getWatch(i,s));return r.useEffect((()=>n._removeUnmounted())),l}({control:s,name:n,defaultValue:g(s._formValues,n,g(s._defaultValues,n,e.defaultValue)),exact:!0}),h=function(e){const t=A(),{control:n=t.control,disabled:i,name:s,exact:o}=e||{},[a,u]=r.useState(n._formState),l=r.useRef(!0),c=r.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),h=r.useRef(s);return h.current=s,L({disabled:i,next:e=>l.current&&O(h.current,e.name,o)&&x(e,c.current,n._updateFormState)&&u({...n._formState,...e}),subject:n._subjects.state}),r.useEffect((()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1})),[n]),D(a,n,c.current,!1)}({control:s,name:n}),d=r.useRef(s.register(n,{...e.rules,value:u,...y(e.disabled)?{disabled:e.disabled}:{}}));return r.useEffect((()=>{const e=s._options.shouldUnregister||o,t=(e,t)=>{const n=g(s._fields,e);n&&(n._f.mount=t)};if(t(n,!0),e){const e=f(g(s._options.defaultValues,n));B(s._defaultValues,n,e),m(g(s._formValues,n))&&B(s._formValues,n,e)}return()=>{(a?e&&!s._state.action:e)?s.unregister(n):t(n,!1)}}),[n,s,a,o]),r.useEffect((()=>{g(s._fields,n)&&s._updateDisabledField({disabled:i,fields:s._fields,name:n,value:g(s._fields,n)._f.value})}),[i,n,s]),{field:{name:n,value:u,...y(i)||h.disabled?{disabled:h.disabled||i}:{},onChange:r.useCallback((e=>d.current.onChange({target:{value:l(e),name:n},type:_.CHANGE})),[n]),onBlur:r.useCallback((()=>d.current.onBlur({target:{value:g(s._formValues,n),name:n},type:_.BLUR})),[n,s]),ref:e=>{const t=g(s._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:h,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!g(h.errors,n)},isDirty:{enumerable:!0,get:()=>!!g(h.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!g(h.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!g(h.validatingFields,n)},error:{enumerable:!0,get:()=>g(h.errors,n)}})}}var H=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},z=e=>({isOnSubmit:!e||e===v.onSubmit,isOnBlur:e===v.onBlur,isOnChange:e===v.onChange,isOnAll:e===v.all,isOnTouch:e===v.onTouched}),q=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const G=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const n=g(e,i);if(n){const{_f:e,...s}=n;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r)break;if(e.ref&&t(e.ref,e.name)&&!r)break;G(s,t)}else u(s)&&G(s,t)}}};var $=(e,t,n)=>{const r=p(g(e,n));return B(r,"root",t[n]),B(e,n,r),e},K=e=>"file"===e.type,W=e=>"function"==typeof e,Q=e=>{if(!d)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Y=e=>M(e),X=e=>"radio"===e.type,J=e=>e instanceof RegExp;const Z={value:!1,isValid:!1},ee={value:!0,isValid:!0};var te=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!m(e[0].attributes.value)?m(e[0].value)||""===e[0].value?ee:{value:e[0].value,isValid:!0}:ee:Z}return Z};const ne={isValid:!1,value:null};var re=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),ne):ne;function ie(e,t,n="validate"){if(Y(e)||Array.isArray(e)&&e.every(Y)||y(e)&&!e)return{type:n,message:Y(e)?e:"",ref:t}}var se=e=>u(e)&&!J(e)?e:{value:e,message:""},oe=async(e,t,n,r,s)=>{const{ref:a,refs:l,required:c,maxLength:h,minLength:d,min:f,max:p,pattern:_,validate:v,name:k,valueAsNumber:A,mount:N,disabled:D}=e._f,x=g(t,k);if(!N||D)return{};const R=l?l[0]:a,O=e=>{r&&R.reportValidity&&(R.setCustomValidity(y(e)?"":e||""),R.reportValidity())},L={},F=X(a),j=i(a),U=F||j,B=(A||K(a))&&m(a.value)&&m(x)||Q(a)&&""===a.value||""===x||Array.isArray(x)&&!x.length,V=H.bind(null,k,n,L),z=(e,t,n,r=E,i=S)=>{const s=e?t:n;L[k]={type:e?r:i,message:s,ref:a,...V(e?r:i,s)}};if(s?!Array.isArray(x)||!x.length:c&&(!U&&(B||o(x))||y(x)&&!x||j&&!te(l).isValid||F&&!re(l).isValid)){const{value:e,message:t}=Y(c)?{value:!!c,message:c}:se(c);if(e&&(L[k]={type:C,message:t,ref:R,...V(C,t)},!n))return O(t),L}if(!(B||o(f)&&o(p))){let e,t;const r=se(p),i=se(f);if(o(x)||isNaN(x)){const n=a.valueAsDate||new Date(x),s=e=>new Date((new Date).toDateString()+" "+e),o="time"==a.type,u="week"==a.type;M(r.value)&&x&&(e=o?s(x)>s(r.value):u?x>r.value:n>new Date(r.value)),M(i.value)&&x&&(t=o?s(x)<s(i.value):u?x<i.value:n<new Date(i.value))}else{const n=a.valueAsNumber||(x?+x:x);o(r.value)||(e=n>r.value),o(i.value)||(t=n<i.value)}if((e||t)&&(z(!!e,r.message,i.message,b,w),!n))return O(L[k].message),L}if((h||d)&&!B&&(M(x)||s&&Array.isArray(x))){const e=se(h),t=se(d),r=!o(e.value)&&x.length>+e.value,i=!o(t.value)&&x.length<+t.value;if((r||i)&&(z(r,e.message,t.message),!n))return O(L[k].message),L}if(_&&!B&&M(x)){const{value:e,message:t}=se(_);if(J(e)&&!x.match(e)&&(L[k]={type:T,message:t,ref:a,...V(T,t)},!n))return O(t),L}if(v)if(W(v)){const e=ie(await v(x,t),R);if(e&&(L[k]={...e,...V(I,e.message)},!n))return O(e.message),L}else if(u(v)){let e={};for(const r in v){if(!P(e)&&!n)break;const i=ie(await v[r](x,t),R,r);i&&(e={...i,...V(r,i.message)},O(i.message),n&&(L[k]=e))}if(!P(e)&&(L[k]={ref:R,...e},!n))return L}return O(!0),L};function ae(e,t){const n=Array.isArray(t)?t:j(t)?[t]:U(t),r=1===n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=m(e)?r++:e[t[r++]];return e}(e,n),i=n.length-1,s=n[i];return r&&delete r[s],0!==i&&(u(r)&&P(r)||Array.isArray(r)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!m(e[t]))return!1;return!0}(r))&&ae(e,n.slice(0,-1)),e}var ue=()=>{let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},le=e=>o(e)||!a(e);function ce(e,t){if(le(e)||le(t))return e===t;if(s(e)&&s(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(s(n)&&s(e)||u(n)&&u(e)||Array.isArray(n)&&Array.isArray(e)?!ce(n,e):n!==e)return!1}}return!0}var he=e=>"select-multiple"===e.type,de=e=>X(e)||i(e),fe=e=>Q(e)&&e.isConnected,pe=e=>{for(const t in e)if(W(e[t]))return!0;return!1};function me(e,t={}){const n=Array.isArray(e);if(u(e)||n)for(const n in e)Array.isArray(e[n])||u(e[n])&&!pe(e[n])?(t[n]=Array.isArray(e[n])?[]:{},me(e[n],t[n])):o(e[n])||(t[n]=!0);return t}function ge(e,t,n){const r=Array.isArray(e);if(u(e)||r)for(const r in e)Array.isArray(e[r])||u(e[r])&&!pe(e[r])?m(t)||le(n[r])?n[r]=Array.isArray(e[r])?me(e[r],[]):{...me(e[r])}:ge(e[r],o(t)?{}:t[r],n[r]):n[r]=!ce(e[r],t[r]);return n}var ye=(e,t)=>ge(e,t,me(t)),_e=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>m(e)?e:t?""===e?NaN:e?+e:e:n&&M(e)?new Date(e):r?r(e):e;function ve(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return K(t)?t.files:X(t)?re(e.refs).value:he(t)?[...t.selectedOptions].map((({value:e})=>e)):i(t)?te(e.refs).value:_e(m(t.value)?e.ref.value:t.value,e)}var be=(e,t,n,r)=>{const i={};for(const n of e){const e=g(t,n);e&&B(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},we=e=>m(e)?e:J(e)?e.source:u(e)?J(e.value)?e.value.source:e.value:e,Ee=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Se(e,t,n){const r=g(e,n);if(r||j(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),s=g(t,r),o=g(e,r);if(s&&!Array.isArray(s)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};i.pop()}return{name:n}}var Te=(e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e),Ce=(e,t)=>!p(g(e,t)).length&&ae(e,t);const Ie={mode:v.onSubmit,reValidateMode:v.onChange,shouldFocusError:!0};function ke(e={}){let t,n={...Ie,...e},r={submitCount:0,isDirty:!1,isLoading:W(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:n.errors||{},disabled:n.disabled||!1},a={},h=(u(n.defaultValues)||u(n.values))&&f(n.defaultValues||n.values)||{},b=n.shouldUnregister?{}:f(h),w={action:!1,mount:!1,watch:!1},E={mount:new Set,unMount:new Set,array:new Set,watch:new Set},S=0;const T={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},C={values:ue(),array:ue(),state:ue()},I=z(n.mode),k=z(n.reValidateMode),A=n.criteriaMode===v.all,N=async e=>{if(T.isValid||e){const e=n.resolver?P((await j()).errors):await U(a,!0);e!==r.isValid&&C.state.next({isValid:e})}},D=(e,t)=>{(T.isValidating||T.validatingFields)&&((e||Array.from(E.mount)).forEach((e=>{e&&(t?B(r.validatingFields,e,t):ae(r.validatingFields,e))})),C.state.next({validatingFields:r.validatingFields,isValidating:!P(r.validatingFields)}))},x=(e,t,n,r)=>{const i=g(a,e);if(i){const s=g(b,e,m(n)?g(h,e):n);m(s)||r&&r.defaultChecked||t?B(b,e,t?s:ve(i._f)):Y(e,s),w.mount&&N()}},O=(e,t,n,i,s)=>{let o=!1,u=!1;const l={name:e},c=!(!g(a,e)||!g(a,e)._f.disabled);if(!n||i){T.isDirty&&(u=r.isDirty,r.isDirty=l.isDirty=V(),o=u!==l.isDirty);const n=c||ce(g(h,e),t);u=!(c||!g(r.dirtyFields,e)),n||c?ae(r.dirtyFields,e):B(r.dirtyFields,e,!0),l.dirtyFields=r.dirtyFields,o=o||T.dirtyFields&&u!==!n}if(n){const t=g(r.touchedFields,e);t||(B(r.touchedFields,e,n),l.touchedFields=r.touchedFields,o=o||T.touchedFields&&t!==n)}return o&&s&&C.state.next(l),o?l:{}},L=(n,i,s,o)=>{const a=g(r.errors,n),u=T.isValid&&y(i)&&r.isValid!==i;var l;if(e.delayError&&s?(l=()=>((e,t)=>{B(r.errors,e,t),C.state.next({errors:r.errors})})(n,s),t=e=>{clearTimeout(S),S=setTimeout(l,e)},t(e.delayError)):(clearTimeout(S),t=null,s?B(r.errors,n,s):ae(r.errors,n)),(s?!ce(a,s):a)||!P(o)||u){const e={...o,...u&&y(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},C.state.next(e)}},j=async e=>{D(e,!0);const t=await n.resolver(b,n.context,be(e||E.mount,a,n.criteriaMode,n.shouldUseNativeValidation));return D(e),t},U=async(e,t,i={valid:!0})=>{for(const s in e){const o=e[s];if(o){const{_f:e,...a}=o;if(e){const a=E.array.has(e.name);D([s],!0);const u=await oe(o,b,A,n.shouldUseNativeValidation&&!t,a);if(D([s]),u[e.name]&&(i.valid=!1,t))break;!t&&(g(u,e.name)?a?$(r.errors,u,e.name):B(r.errors,e.name,u[e.name]):ae(r.errors,e.name))}a&&await U(a,t,i)}}return i.valid},V=(e,t)=>(e&&t&&B(b,e,t),!ce(ne(),h)),H=(e,t,n)=>F(e,E,{...w.mount?b:m(t)?h:M(e)?{[e]:t}:t},n,t),Y=(e,t,n={})=>{const r=g(a,e);let s=t;if(r){const n=r._f;n&&(!n.disabled&&B(b,e,_e(t,n)),s=Q(n.ref)&&o(t)?"":t,he(n.ref)?[...n.ref.options].forEach((e=>e.selected=s.includes(e.value))):n.refs?i(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(s)?!!s.find((t=>t===e.value)):s===e.value))):n.refs[0]&&(n.refs[0].checked=!!s):n.refs.forEach((e=>e.checked=e.value===s)):K(n.ref)?n.ref.value="":(n.ref.value=s,n.ref.type||C.values.next({name:e,values:{...b}})))}(n.shouldDirty||n.shouldTouch)&&O(e,s,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&te(e)},X=(e,t,n)=>{for(const r in t){const i=t[r],o=`${e}.${r}`,u=g(a,o);!E.array.has(e)&&le(i)&&(!u||u._f)||s(i)?Y(o,i,n):X(o,i,n)}},J=(e,t,n={})=>{const i=g(a,e),s=E.array.has(e),u=f(t);B(b,e,u),s?(C.array.next({name:e,values:{...b}}),(T.isDirty||T.dirtyFields)&&n.shouldDirty&&C.state.next({name:e,dirtyFields:ye(h,b),isDirty:V(e,u)})):!i||i._f||o(u)?Y(e,u,n):X(e,u,n),q(e,E)&&C.state.next({...r}),C.values.next({name:w.mount?e:void 0,values:{...b}})},Z=async e=>{w.mount=!0;const i=e.target;let s=i.name,o=!0;const u=g(a,s),c=e=>{o=Number.isNaN(e)||e===g(b,s,e)};if(u){let h,d;const f=i.type?ve(u._f):l(e),p=e.type===_.BLUR||e.type===_.FOCUS_OUT,m=!Ee(u._f)&&!n.resolver&&!g(r.errors,s)&&!u._f.deps||Te(p,g(r.touchedFields,s),r.isSubmitted,k,I),y=q(s,E,p);B(b,s,f),p?(u._f.onBlur&&u._f.onBlur(e),t&&t(0)):u._f.onChange&&u._f.onChange(e);const v=O(s,f,p,!1),w=!P(v)||y;if(!p&&C.values.next({name:s,type:e.type,values:{...b}}),m)return T.isValid&&N(),w&&C.state.next({name:s,...y?{}:v});if(!p&&y&&C.state.next({...r}),n.resolver){const{errors:e}=await j([s]);if(c(f),o){const t=Se(r.errors,a,s),n=Se(e,a,t.name||s);h=n.error,s=n.name,d=P(e)}}else D([s],!0),h=(await oe(u,b,A,n.shouldUseNativeValidation))[s],D([s]),c(f),o&&(h?d=!1:T.isValid&&(d=await U(a,!0)));o&&(u._f.deps&&te(u._f.deps),L(s,d,h,v))}},ee=(e,t)=>{if(g(r.errors,t)&&e.focus)return e.focus(),1},te=async(e,t={})=>{let i,s;const o=R(e);if(n.resolver){const t=await(async e=>{const{errors:t}=await j(e);if(e)for(const n of e){const e=g(t,n);e?B(r.errors,n,e):ae(r.errors,n)}else r.errors=t;return t})(m(e)?e:o);i=P(t),s=e?!o.some((e=>g(t,e))):i}else e?(s=(await Promise.all(o.map((async e=>{const t=g(a,e);return await U(t&&t._f?{[e]:t}:t)})))).every(Boolean),(s||r.isValid)&&N()):s=i=await U(a);return C.state.next({...!M(e)||T.isValid&&i!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:i}:{},errors:r.errors}),t.shouldFocus&&!s&&G(a,ee,e?o:E.mount),s},ne=e=>{const t={...h,...w.mount?b:{}};return m(e)?t:M(e)?g(t,e):e.map((e=>g(t,e)))},re=(e,t)=>({invalid:!!g((t||r).errors,e),isDirty:!!g((t||r).dirtyFields,e),isTouched:!!g((t||r).touchedFields,e),isValidating:!!g((t||r).validatingFields,e),error:g((t||r).errors,e)}),ie=(e,t,n)=>{const i=(g(a,e,{_f:{}})._f||{}).ref;B(r.errors,e,{...t,ref:i}),C.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&i&&i.focus&&i.focus()},se=(e,t={})=>{for(const i of e?R(e):E.mount)E.mount.delete(i),E.array.delete(i),t.keepValue||(ae(a,i),ae(b,i)),!t.keepError&&ae(r.errors,i),!t.keepDirty&&ae(r.dirtyFields,i),!t.keepTouched&&ae(r.touchedFields,i),!t.keepIsValidating&&ae(r.validatingFields,i),!n.shouldUnregister&&!t.keepDefaultValue&&ae(h,i);C.values.next({values:{...b}}),C.state.next({...r,...t.keepDirty?{isDirty:V()}:{}}),!t.keepIsValid&&N()},pe=({disabled:e,name:t,field:n,fields:r,value:i})=>{if(y(e)){const s=e?void 0:m(i)?ve(n?n._f:g(r,t)._f):i;B(b,t,s),O(t,s,!1,!1,!0)}},me=(e,t={})=>{let r=g(a,e);const i=y(t.disabled);return B(a,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),E.mount.add(e),r?pe({field:r,disabled:t.disabled,name:e,value:t.value}):x(e,!0,t.value),{...i?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:we(t.min),max:we(t.max),minLength:we(t.minLength),maxLength:we(t.maxLength),pattern:we(t.pattern)}:{},name:e,onChange:Z,onBlur:Z,ref:i=>{if(i){me(e,t),r=g(a,e);const n=m(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=de(n),o=r._f.refs||[];if(s?o.find((e=>e===n)):n===r._f.ref)return;B(a,e,{_f:{...r._f,...s?{refs:[...o.filter(fe),n,...Array.isArray(g(h,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),x(e,!1,void 0,n)}else r=g(a,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!c(E.array,e)||!w.action)&&E.unMount.add(e)}}},ge=()=>n.shouldFocusError&&G(a,ee,E.mount),ke=(e,t)=>async i=>{let s;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let o=f(b);if(C.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await j();r.errors=e,o=t}else await U(a);if(ae(r.errors,"root"),P(r.errors)){C.state.next({errors:{}});try{await e(o,i)}catch(e){s=e}}else t&&await t({...r.errors},i),ge(),setTimeout(ge);if(C.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:P(r.errors)&&!s,submitCount:r.submitCount+1,errors:r.errors}),s)throw s},Ae=(t,n={})=>{const i=t?f(t):h,s=f(i),o=P(t),u=o?h:s;if(n.keepDefaultValues||(h=i),!n.keepValues){if(n.keepDirtyValues)for(const e of E.mount)g(r.dirtyFields,e)?B(u,e,g(b,e)):J(e,g(u,e));else{if(d&&m(t))for(const e of E.mount){const t=g(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Q(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}b=e.shouldUnregister?n.keepDefaultValues?f(h):{}:f(u),C.array.next({values:{...u}}),C.values.next({values:{...u}})}E={mount:n.keepDirtyValues?E.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},w.mount=!T.isValid||!!n.keepIsValid||!!n.keepDirtyValues,w.watch=!!e.shouldUnregister,C.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:!o&&(n.keepDirty?r.isDirty:!(!n.keepDefaultValues||ce(t,h))),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:o?[]:n.keepDirtyValues?n.keepDefaultValues&&b?ye(h,b):r.dirtyFields:n.keepDefaultValues&&t?ye(h,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitSuccessful:!!n.keepIsSubmitSuccessful&&r.isSubmitSuccessful,isSubmitting:!1})},Ne=(e,t)=>Ae(W(e)?e(b):e,t);return{control:{register:me,unregister:se,getFieldState:re,handleSubmit:ke,setError:ie,_executeSchema:j,_getWatch:H,_getDirty:V,_updateValid:N,_removeUnmounted:()=>{for(const e of E.unMount){const t=g(a,e);t&&(t._f.refs?t._f.refs.every((e=>!fe(e))):!fe(t._f.ref))&&se(e)}E.unMount=new Set},_updateFieldArray:(e,t=[],n,i,s=!0,o=!0)=>{if(i&&n){if(w.action=!0,o&&Array.isArray(g(a,e))){const t=n(g(a,e),i.argA,i.argB);s&&B(a,e,t)}if(o&&Array.isArray(g(r.errors,e))){const t=n(g(r.errors,e),i.argA,i.argB);s&&B(r.errors,e,t),Ce(r.errors,e)}if(T.touchedFields&&o&&Array.isArray(g(r.touchedFields,e))){const t=n(g(r.touchedFields,e),i.argA,i.argB);s&&B(r.touchedFields,e,t)}T.dirtyFields&&(r.dirtyFields=ye(h,b)),C.state.next({name:e,isDirty:V(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else B(b,e,t)},_updateDisabledField:pe,_getFieldArray:t=>p(g(w.mount?b:h,t,e.shouldUnregister?g(h,t,[]):[])),_reset:Ae,_resetDefaultValues:()=>W(n.defaultValues)&&n.defaultValues().then((e=>{Ne(e,n.resetOptions),C.state.next({isLoading:!1})})),_updateFormState:e=>{r={...r,...e}},_disableForm:e=>{y(e)&&(C.state.next({disabled:e}),G(a,((t,n)=>{let r=e;const i=g(a,n);i&&y(i._f.disabled)&&(r||(r=i._f.disabled)),t.disabled=r}),0,!1))},_subjects:C,_proxyFormState:T,_setErrors:e=>{r.errors=e,C.state.next({errors:r.errors,isValid:!1})},get _fields(){return a},get _formValues(){return b},get _state(){return w},set _state(e){w=e},get _defaultValues(){return h},get _names(){return E},set _names(e){E=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:te,register:me,handleSubmit:ke,watch:(e,t)=>W(e)?C.values.subscribe({next:n=>e(H(void 0,t),n)}):H(e,t,!0),setValue:J,getValues:ne,reset:Ne,resetField:(e,t={})=>{g(a,e)&&(m(t.defaultValue)?J(e,f(g(h,e))):(J(e,t.defaultValue),B(h,e,f(t.defaultValue))),t.keepTouched||ae(r.touchedFields,e),t.keepDirty||(ae(r.dirtyFields,e),r.isDirty=t.defaultValue?V(e,f(g(h,e))):V()),t.keepError||(ae(r.errors,e),T.isValid&&N()),C.state.next({...r}))},clearErrors:e=>{e&&R(e).forEach((e=>ae(r.errors,e))),C.state.next({errors:e?r.errors:{}})},unregister:se,setError:ie,setFocus:(e,t={})=>{const n=g(a,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:re}}function Ae(e={}){const t=r.useRef(),n=r.useRef(),[i,s]=r.useState({isDirty:!1,isValidating:!1,isLoading:W(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:W(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...ke(e),formState:i});const o=t.current.control;return o._options=e,L({subject:o._subjects.state,next:e=>{x(e,o._proxyFormState,o._updateFormState,!0)&&s({...o._formState})}}),r.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),r.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,i.isDirty]),r.useEffect((()=>{e.values&&!ce(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),r.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),r.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),r.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=D(i,o),t.current}},"./node_modules/react-redux/dist/react-redux.mjs":function(e,t,n){"use strict";n.d(t,{Kq:function(){return ce},Ng:function(){return le},d4:function(){return g},wA:function(){return me}});var r=n("./node_modules/react/index.js"),i=n("./node_modules/use-sync-external-store/with-selector.js"),s=r,o=Symbol.for("react-redux-context"),a="undefined"!=typeof globalThis?globalThis:{};function u(){if(!s.createContext)return{};const e=a[o]??(a[o]=new Map);let t=e.get(s.createContext);return t||(t=s.createContext(null),e.set(s.createContext,t)),t}var l=u(),c=()=>{throw new Error("uSES not initialized!")};function h(e=l){return function(){return s.useContext(e)}}var d=h(),f=c,p=(e,t)=>e===t;function m(e=l){const t=e===l?d:h(e),n=(e,n={})=>{const{equalityFn:r=p,devModeChecks:i={}}="function"==typeof n?{equalityFn:n}:n;const{store:o,subscription:a,getServerState:u,stabilityCheck:l,identityFunctionCheck:c}=t(),h=(s.useRef(!0),s.useCallback({[e.name](t){return e(t)}}[e.name],[e,l,i.stabilityCheck])),d=f(a.addNestedSub,o.getState,u||o.getState,h,r);return s.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var g=m(),y=Symbol.for("react.element"),_=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),S=Symbol.for("react.context"),T=Symbol.for("react.server_context"),C=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),D=(Symbol.for("react.offscreen"),Symbol.for("react.client.reference"),C),P=A;function x(e){if("object"==typeof e&&null!==e){const t=e.$$typeof;switch(t){case y:{const n=e.type;switch(n){case v:case w:case b:case I:case k:return n;default:{const e=n&&n.$$typeof;switch(e){case T:case S:case C:case N:case A:case E:return e;default:return t}}}}case _:return t}}}function R(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:s,areStatePropsEqual:o}){let a,u,l,c,h,d=!1;function f(d,f){const p=!s(f,u),m=!i(d,a,f,u);return a=d,u=f,p&&m?(l=e(a,u),t.dependsOnOwnProps&&(c=t(r,u)),h=n(l,c,u),h):p?(e.dependsOnOwnProps&&(l=e(a,u)),t.dependsOnOwnProps&&(c=t(r,u)),h=n(l,c,u),h):m?function(){const t=e(a,u),r=!o(t,l);return l=t,r&&(h=n(l,c,u)),h}():h}return function(i,s){return d?f(i,s):(a=i,u=s,l=e(a,u),c=t(r,u),h=n(l,c,u),d=!0,h)}}function O(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function L(e){return e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function M(e,t){return function(t,{displayName:n}){const r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=L(e);let i=r(t,n);return"function"==typeof i&&(r.mapToProps=i,r.dependsOnOwnProps=L(i),i=r(t,n)),i},r}}function F(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function j(e,t,n){return{...n,...e,...t}}function U(e){e()}var B={notify(){},get:()=>[]};function V(e,t){let n,r=B,i=0,s=!1;function o(){l.onStateChange&&l.onStateChange()}function a(){i++,n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){U((()=>{let t=e;for(;t;)t.callback(),t=t.next}))},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){r&&null!==e&&(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}())}function u(){i--,n&&0===i&&(n(),n=void 0,r.clear(),r=B)}const l={addNestedSub:function(e){a();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),u())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,a())},tryUnsubscribe:function(){s&&(s=!1,u())},getListeners:()=>r};return l}var H=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),z="undefined"!=typeof navigator&&"ReactNative"===navigator.product,q=H||z?s.useLayoutEffect:s.useEffect;function G(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function $(e,t){if(G(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!G(e[n[r]],t[n[r]]))return!1;return!0}var K={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},W={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Q={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Y={[D]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[P]:Q};function X(e){return x(e)===A?Q:Y[e.$$typeof]||K}var J=Object.defineProperty,Z=Object.getOwnPropertyNames,ee=Object.getOwnPropertySymbols,te=Object.getOwnPropertyDescriptor,ne=Object.getPrototypeOf,re=Object.prototype;function ie(e,t){if("string"!=typeof t){if(re){const n=ne(t);n&&n!==re&&ie(e,n)}let n=Z(t);ee&&(n=n.concat(ee(t)));const r=X(e),i=X(t);for(let s=0;s<n.length;++s){const o=n[s];if(!(W[o]||i&&i[o]||r&&r[o])){const n=te(t,o);try{J(e,o,n)}catch(e){}}}}return e}var se=c,oe=[null,null];function ae(e,t,n,r,i,s){e.current=r,n.current=!1,i.current&&(i.current=null,s())}function ue(e,t){return e===t}var le=function(e,t,n,{pure:r,areStatesEqual:i=ue,areOwnPropsEqual:o=$,areStatePropsEqual:a=$,areMergedPropsEqual:u=$,forwardRef:c=!1,context:h=l}={}){const d=h,f=function(e){return e?"function"==typeof e?M(e):F(e,"mapStateToProps"):O((()=>({})))}(e),p=function(e){return e&&"object"==typeof e?O((t=>function(e,t){const n={};for(const r in e){const i=e[r];"function"==typeof i&&(n[r]=(...e)=>t(i(...e)))}return n}(e,t))):e?"function"==typeof e?M(e):F(e,"mapDispatchToProps"):O((e=>({dispatch:e})))}(t),m=function(e){return e?"function"==typeof e?function(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i,s=!1;return function(t,n,o){const a=e(t,n,o);return s?r(a,i)||(i=a):(s=!0,i=a),i}}}(e):F(e,"mergeProps"):()=>j}(n),g=Boolean(e);return e=>{const t=e.displayName||e.name||"Component",n=`Connect(${t})`,r={shouldHandleStateChanges:g,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:f,initMapDispatchToProps:p,initMergeProps:m,areStatesEqual:i,areStatePropsEqual:a,areOwnPropsEqual:o,areMergedPropsEqual:u};function l(t){const[n,i,o]=s.useMemo((()=>{const{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]}),[t]),a=s.useMemo((()=>d),[n,d]),u=s.useContext(a),l=Boolean(t.store)&&Boolean(t.store.getState)&&Boolean(t.store.dispatch),c=Boolean(u)&&Boolean(u.store);const h=l?t.store:u.store,f=c?u.getServerState:h.getState,p=s.useMemo((()=>function(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return R(t(e,i),n(e,i),r(e,i),e,i)}(h.dispatch,r)),[h]),[m,y]=s.useMemo((()=>{if(!g)return oe;const e=V(h,l?void 0:u.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[h,l,u]),_=s.useMemo((()=>l?u:{...u,subscription:m}),[l,u,m]),v=s.useRef(void 0),b=s.useRef(o),w=s.useRef(void 0),E=s.useRef(!1),S=s.useRef(!1),T=s.useRef(void 0);q((()=>(S.current=!0,()=>{S.current=!1})),[]);const C=s.useMemo((()=>()=>w.current&&o===b.current?w.current:p(h.getState(),o)),[h,o]),I=s.useMemo((()=>e=>m?function(e,t,n,r,i,s,o,a,u,l,c){if(!e)return()=>{};let h=!1,d=null;const f=()=>{if(h||!a.current)return;const e=t.getState();let n,f;try{n=r(e,i.current)}catch(e){f=e,d=e}f||(d=null),n===s.current?o.current||l():(s.current=n,u.current=n,o.current=!0,c())};return n.onStateChange=f,n.trySubscribe(),f(),()=>{if(h=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}(g,h,m,p,b,v,E,S,w,y,e):()=>{}),[m]);var k,A,N;let D;k=ae,A=[b,v,E,o,w,y],q((()=>k(...A)),N);try{D=se(I,C,f?()=>p(f(),o):C)}catch(e){throw T.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${T.current.stack}\n\n`),e}q((()=>{T.current=void 0,w.current=void 0,v.current=D}));const P=s.useMemo((()=>s.createElement(e,{...D,ref:i})),[i,e,D]);return s.useMemo((()=>g?s.createElement(a.Provider,{value:_},P):P),[a,P,_])}const h=s.memo(l);if(h.WrappedComponent=e,h.displayName=l.displayName=n,c){const t=s.forwardRef((function(e,t){return s.createElement(h,{...e,reactReduxForwardedRef:t})}));return t.displayName=n,t.WrappedComponent=e,ie(t,e)}return ie(h,e)}};var ce=function({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",identityFunctionCheck:o="once"}){const a=s.useMemo((()=>{const t=V(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:i,identityFunctionCheck:o}}),[e,r,i,o]),u=s.useMemo((()=>e.getState()),[e]);q((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),u!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,u]);const c=t||l;return s.createElement(c.Provider,{value:a},n)};function he(e=l){const t=e===l?d:h(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var de=he();function fe(e=l){const t=e===l?de:he(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var pe,me=fe();pe=i.useSyncExternalStoreWithSelector,f=pe,(e=>{se=e})(r.useSyncExternalStore)},"./node_modules/redux/dist/redux.mjs":function(e,t,n){"use strict";function r(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}n.d(t,{HY:function(){return l},Qd:function(){return a},Tw:function(){return h},Zz:function(){return c},ve:function(){return d},y$:function(){return u}});var i=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),s=()=>Math.random().toString(36).substring(7).split("").join("."),o={INIT:`@@redux/INIT${s()}`,REPLACE:`@@redux/REPLACE${s()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${s()}`};function a(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function u(e,t,n){if("function"!=typeof e)throw new Error(r(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(r(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(r(1));return n(u)(e,t)}let s=e,l=t,c=new Map,h=c,d=0,f=!1;function p(){h===c&&(h=new Map,c.forEach(((e,t)=>{h.set(t,e)})))}function m(){if(f)throw new Error(r(3));return l}function g(e){if("function"!=typeof e)throw new Error(r(4));if(f)throw new Error(r(5));let t=!0;p();const n=d++;return h.set(n,e),function(){if(t){if(f)throw new Error(r(6));t=!1,p(),h.delete(n),c=null}}}function y(e){if(!a(e))throw new Error(r(7));if(void 0===e.type)throw new Error(r(8));if("string"!=typeof e.type)throw new Error(r(17));if(f)throw new Error(r(9));try{f=!0,l=s(l,e)}finally{f=!1}return(c=h).forEach((e=>{e()})),e}y({type:o.INIT});return{dispatch:y,subscribe:g,getState:m,replaceReducer:function(e){if("function"!=typeof e)throw new Error(r(10));s=e,y({type:o.REPLACE})},[i]:function(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(r(11));function n(){const e=t;e.next&&e.next(m())}n();return{unsubscribe:e(n)}},[i](){return this}}}}}function l(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const i=t[r];0,"function"==typeof e[i]&&(n[i]=e[i])}const i=Object.keys(n);let s;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:o.INIT}))throw new Error(r(12));if(void 0===n(void 0,{type:o.PROBE_UNKNOWN_ACTION()}))throw new Error(r(13))}))}(n)}catch(e){s=e}return function(e={},t){if(s)throw s;let o=!1;const a={};for(let s=0;s<i.length;s++){const u=i[s],l=n[u],c=e[u],h=l(c,t);if(void 0===h){t&&t.type;throw new Error(r(14))}a[u]=h,o=o||h!==c}return o=o||i.length!==Object.keys(e).length,o?a:e}}function c(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function h(...e){return t=>(n,i)=>{const s=t(n,i);let o=()=>{throw new Error(r(15))};const a={getState:s.getState,dispatch:(e,...t)=>o(e,...t)},u=e.map((e=>e(a)));return o=c(...u)(s.dispatch),{...s,dispatch:o}}}function d(e){return a(e)&&"type"in e&&"string"==typeof e.type}},"./node_modules/tslib/tslib.es6.mjs":function(e,t,n){"use strict";n.r(t),n.d(t,{__addDisposableResource:function(){return O},__assign:function(){return s},__asyncDelegator:function(){return C},__asyncGenerator:function(){return T},__asyncValues:function(){return I},__await:function(){return S},__awaiter:function(){return p},__classPrivateFieldGet:function(){return P},__classPrivateFieldIn:function(){return R},__classPrivateFieldSet:function(){return x},__createBinding:function(){return g},__decorate:function(){return a},__disposeResources:function(){return M},__esDecorate:function(){return l},__exportStar:function(){return y},__extends:function(){return i},__generator:function(){return m},__importDefault:function(){return D},__importStar:function(){return N},__makeTemplateObject:function(){return k},__metadata:function(){return f},__param:function(){return u},__propKey:function(){return h},__read:function(){return v},__rest:function(){return o},__runInitializers:function(){return c},__setFunctionName:function(){return d},__spread:function(){return b},__spreadArray:function(){return E},__spreadArrays:function(){return w},__values:function(){return _}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function u(e,t){return function(n,r){t(n,r,e)}}function l(e,t,n,r,i,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,u=r.kind,l="getter"===u?"get":"setter"===u?"set":"value",c=!t&&e?r.static?e:e.prototype:null,h=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),d=!1,f=n.length-1;f>=0;f--){var p={};for(var m in r)p[m]="access"===m?{}:r[m];for(var m in r.access)p.access[m]=r.access[m];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var g=(0,n[f])("accessor"===u?{get:h.get,set:h.set}:h[l],p);if("accessor"===u){if(void 0===g)continue;if(null===g||"object"!=typeof g)throw new TypeError("Object expected");(a=o(g.get))&&(h.get=a),(a=o(g.set))&&(h.set=a),(a=o(g.init))&&i.unshift(a)}else(a=o(g))&&("field"===u?i.unshift(a):h[l]=a)}c&&Object.defineProperty(c,r.name,h),d=!0}function c(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}u((r=r.apply(e,t||[])).next())}))}function m(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var g=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function y(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||g(t,e,n)}function _(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function w(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function E(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function S(e){return this instanceof S?(this.v=e,this):new S(e)}function T(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof S?Promise.resolve(n.value.v).then(u,l):c(s[0][2],n)}catch(e){c(s[0][3],e)}var n}function u(e){a("next",e)}function l(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function C(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:S(e[r](t)),done:!1}:i?i(t):t}:i}}function I(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=_(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function k(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function N(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&g(t,e,n);return A(t,e),t}function D(e){return e&&e.__esModule?e:{default:e}}function P(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function x(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function O(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var L="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function M(e){function t(t){e.error=e.hasError?new L(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:i,__assign:s,__rest:o,__decorate:a,__param:u,__metadata:f,__awaiter:p,__generator:m,__createBinding:g,__exportStar:y,__values:_,__read:v,__spread:b,__spreadArrays:w,__spreadArray:E,__await:S,__asyncGenerator:T,__asyncDelegator:C,__asyncValues:I,__makeTemplateObject:k,__importStar:N,__importDefault:D,__classPrivateFieldGet:P,__classPrivateFieldSet:x,__classPrivateFieldIn:R,__addDisposableResource:O,__disposeResources:M}}}]);